Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net5 #3

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

net5 #3

wants to merge 3 commits into from

Conversation

bitfaster
Copy link
Owner

@bitfaster bitfaster commented Feb 12, 2022

Migrate to public span based convert API, all unit tests pass on net5 target.

dotnet run -f net5.0 -c Release --job short --runtimes netcoreapp50 --filter *StringFromBase64Loh*

BenchmarkDotNet=v0.12.1, OS=Windows 10.0.22000
Intel Core i7-1065G7 CPU 1.30GHz, 1 CPU, 8 logical and 4 physical cores
.NET Core SDK=5.0.405
  [Host]     : .NET Core 5.0.14 (CoreCLR 5.0.1422.5710, CoreFX 5.0.1422.5710), X64 RyuJIT
  Job-WLZFHQ : .NET Core 5.0.14 (CoreCLR 5.0.1422.5710, CoreFX 5.0.1422.5710), X64 RyuJIT

Runtime=.NET Core 5.0  Toolchain=netcoreapp50  IterationCount=3
LaunchCount=1  WarmupCount=3
Method Mean Error StdDev Ratio Gen 0 Gen 1 Gen 2 Allocated
ConvertFrom 1,159.8 us 209.3 us 11.47 us 1.00 324.2188 324.2188 324.2188 1464.88 KB
StreamFrom 1,141.5 us 449.9 us 24.66 us 0.98 195.3125 195.3125 195.3125 978.05 KB
GetBytes 181.4 us 238.4 us 13.07 us 0.16 137.9395 137.9395 137.9395 651.07 KB
dotnet run -f net5.0 -c Release --job short --runtimes netcoreapp50 --filter *StreamFromBase64*

Runtime=.NET Core 5.0  Toolchain=netcoreapp50  IterationCount=3
LaunchCount=1  WarmupCount=3
Method input Mean Error StdDev Ratio RatioSD Gen 0 Gen 1 Gen 2 Allocated
ConvertFrom 1024 1,885.4 ns 394.39 ns 21.62 ns 1.00 0.00 0.7439 - - 3120 B
StreamFrom 1024 1,874.2 ns 607.79 ns 33.31 ns 0.99 0.03 0.0401 - - 168 B
ConvertFrom 131072 335,511.0 ns 168,510.10 ns 9,236.61 ns 1.00 0.00 124.5117 124.5117 124.5117 393264 B
StreamFrom 131072 217,118.6 ns 100,933.58 ns 5,532.51 ns 0.65 0.00 - - - 168 B
ConvertFrom 16384 27,378.6 ns 6,776.70 ns 371.45 ns 1.00 0.00 11.6882 - - 49200 B
StreamFrom 16384 27,171.7 ns 7,806.86 ns 427.92 ns 0.99 0.02 0.0305 - - 168 B
ConvertFrom 2048 3,627.9 ns 1,052.74 ns 57.70 ns 1.00 0.00 1.4763 - - 6192 B
StreamFrom 2048 3,564.2 ns 1,143.63 ns 62.69 ns 0.98 0.03 0.0381 - - 168 B
ConvertFrom 256 537.5 ns 106.19 ns 5.82 ns 1.00 0.00 0.1945 - - 816 B
StreamFrom 256 628.8 ns 69.48 ns 3.81 ns 1.17 0.01 0.0401 - - 168 B
ConvertFrom 32768 55,648.4 ns 24,753.53 ns 1,356.82 ns 1.00 0.00 23.2544 - - 98352 B
StreamFrom 32768 56,219.0 ns 4,409.07 ns 241.68 ns 1.01 0.03 - - - 168 B
ConvertFrom 4096 7,147.8 ns 1,930.95 ns 105.84 ns 1.00 0.00 2.9449 - - 12336 B
StreamFrom 4096 7,091.8 ns 1,949.01 ns 106.83 ns 0.99 0.03 0.0381 - - 168 B
ConvertFrom 512 1,001.8 ns 90.77 ns 4.98 ns 1.00 0.00 0.3777 - - 1584 B
StreamFrom 512 1,122.2 ns 228.36 ns 12.52 ns 1.12 0.02 0.0401 - - 168 B
ConvertFrom 65536 159,749.9 ns 70,582.66 ns 3,868.87 ns 1.00 0.00 41.5039 41.5039 41.5039 196656 B
StreamFrom 65536 108,982.0 ns 116,953.01 ns 6,410.59 ns 0.68 0.05 - - - 168 B
ConvertFrom 8192 13,944.8 ns 3,303.35 ns 181.07 ns 1.00 0.00 5.8594 - - 24624 B
StreamFrom 8192 13,575.3 ns 4,283.37 ns 234.79 ns 0.97 0.02 0.0305 - - 168 B

@bitfaster
Copy link
Owner Author

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