Skip to content

Stream to File: port to .NET 11 and fix the benchmark setup - #2412

Open
vladimir-pecanac-main wants to merge 1 commit into
CodeMazeBlog:mainfrom
vladimir-pecanac-main:seo/120486-csharp-convert-a-stream-to-a-file
Open

vladimir-pecanac-main wants to merge 1 commit into
CodeMazeBlog:mainfrom
vladimir-pecanac-main:seo/120486-csharp-convert-a-stream-to-a-file

Conversation

@vladimir-pecanac-main

Copy link
Copy Markdown
Collaborator

Ports csharp-intermediate-topics/HowToConvertAStreamToAFileInCSharp to net11.0 with BenchmarkDotNet 0.15.8 ([InProcess]), MSTest 4.5.3, Microsoft.NET.Test.Sdk 18.12.0 and coverlet.collector 10.1.0. The benchmark class now loads the image in [GlobalSetup] instead of reading statics that Program.cs set, which stayed empty in the separate benchmark process, so the old numbers measured an empty stream. Adds CopyToFileAsync with a test and a benchmark, a demo of what CopyTo does with Position, and tests that compare each written file with the source byte for byte.

…sync

Both projects target net11.0. BenchmarkDotNet 0.15.8 with [InProcess]; the
benchmark loads its input in [GlobalSetup] instead of reading statics set in
Program.cs, so it measures the real image. Adds CopyToFileAsync with a test and
a benchmark, a CopyTo position demo in Program.cs, and tests that compare every
written file with the source byte for byte. MSTest 4.5.3, Test.Sdk 18.12.0,
coverlet 10.1.0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant