Skip to content

[Benchmark X64] [stephentoub] Rewrite BigInteger internals to use native-wid ... #1828

Open

Description

@MihuBot

Job completed in 29 minutes 46 seconds (remote runner delay: 59 seconds).
dotnet/runtime#125799
Using arguments: benchmark BigInteger
Main commit: dotnet/runtime@37c9693
PR commit: stephentoub/runtime@3dbb09e

System.Numerics.Tests.Perf_BigInteger
BenchmarkDotNet v0.16.0-nightly.20260302.459, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 9V74 2.60GHz, 1 CPU, 8 logical and 4 physical cores
Memory: 31.34 GB Total, 2.77 GB Available
  Job-TPEJOW : .NET 11.0.0 (11.0.0-dev, 42.42.42.42424), X64 RyuJIT x86-64-v4
  Job-HKHXHK : .NET 11.0.0 (11.0.0-dev, 42.42.42.42424), X64 RyuJIT x86-64-v4
  Job-NRQIIJ : .NET 11.0.0 (11.0.0-dev, 42.42.42.42424), X64 RyuJIT x86-64-v4
  Job-NGSIDY : .NET 11.0.0 (11.0.0-dev, 42.42.42.42424), X64 RyuJIT x86-64-v4
EvaluateOverhead=False  PowerPlanMode=  IterationTime=250ms
MaxIterationCount=20  MinIterationCount=15  WarmupCount=1
Method Toolchain numberString arguments Mean Error Ratio Allocated Alloc Ratio
Ctor_ByteArray Main -2147483648 ? 11.172 ns 0.0296 ns 1.00 - NA
Ctor_ByteArray PR -2147483648 ? 11.448 ns 0.0945 ns 1.02 - NA
ToByteArray Main -2147483648 ? 9.778 ns 0.0832 ns 1.00 32 B 1.00
ToByteArray PR -2147483648 ? 13.737 ns 0.0283 ns 1.40 32 B 1.00
Parse Main -2147483648 ? 91.739 ns 0.0880 ns 1.00 - NA
Parse PR -2147483648 ? 96.282 ns 0.0485 ns 1.05 - NA
ToStringX Main -2147483648 ? 47.979 ns 0.0711 ns 1.00 40 B 1.00
ToStringX PR -2147483648 ? 55.147 ns 0.0648 ns 1.15 40 B 1.00
ToStringD Main -2147483648 ? 72.383 ns 0.2596 ns 1.00 48 B 1.00
ToStringD PR -2147483648 ? 53.497 ns 0.1333 ns 0.74 48 B 1.00
Add Main ? 1024,1024 bits 59.933 ns 0.1941 ns 1.00 160 B 1.00
Add PR ? 1024,1024 bits 56.986 ns 0.5884 ns 0.95 160 B 1.00
Subtract Main ? 1024,1024 bits 59.955 ns 0.1576 ns 1.00 152 B 1.00
Subtract PR ? 1024,1024 bits 56.503 ns 0.2578 ns 0.94 152 B 1.00
GreatestCommonDivisor Main ? 1024,1024 bits 4,454.831 ns 22.2209 ns 1.00 - NA
GreatestCommonDivisor PR ? 1024,1024 bits 4,650.313 ns 18.2393 ns 1.04 - NA
Multiply Main ? 1024,1024 bits 793.060 ns 2.9322 ns 1.00 280 B 1.00
Multiply PR ? 1024,1024 bits 442.427 ns 4.8465 ns 0.56 280 B 1.00
ModPow Main ? 1024,1024,64 bits 60,141.970 ns 355.7101 ns 1.00 32 B 1.00
ModPow PR ? 1024,1024,64 bits 24,918.748 ns 13.4063 ns 0.41 32 B 1.00
Divide Main ? 1024,512 bits 365.450 ns 0.3674 ns 1.00 96 B 1.00
Divide PR ? 1024,512 bits 241.898 ns 0.3106 ns 0.66 96 B 1.00
Remainder Main ? 1024,512 bits 376.738 ns 1.2742 ns 1.00 88 B 1.00
Remainder PR ? 1024,512 bits 250.728 ns 0.3825 ns 0.67 88 B 1.00
Multiply Main ? 1024,512 bits 465.764 ns 1.9536 ns 1.00 216 B 1.00
Multiply PR ? 1024,512 bits 238.197 ns 1.2516 ns 0.51 216 B 1.00
Ctor_ByteArray Main 123 ? 8.586 ns 0.0096 ns 1.00 - NA
Ctor_ByteArray PR 123 ? 8.613 ns 0.0023 ns 1.00 - NA
ToByteArray Main 123 ? 7.502 ns 0.0142 ns 1.00 32 B 1.00
ToByteArray PR 123 ? 8.201 ns 0.0209 ns 1.09 32 B 1.00
Parse Main 123 ? 63.682 ns 0.0316 ns 1.00 - NA
Parse PR 123 ? 74.875 ns 0.3422 ns 1.18 - NA
ToStringX Main 123 ? 41.379 ns 0.0801 ns 1.00 32 B 1.00
ToStringX PR 123 ? 42.909 ns 0.1659 ns 1.04 32 B 1.00
ToStringD Main 123 ? 21.349 ns 0.0440 ns 1.00 - NA
ToStringD PR 123 ? 21.566 ns 0.0612 ns 1.01 - NA
Ctor_ByteArray Main 123456789012(...)901234567890 [200] ? 15.585 ns 0.0891 ns 1.00 112 B 1.00
Ctor_ByteArray PR 123456789012(...)901234567890 [200] ? 16.241 ns 0.1156 ns 1.04 112 B 1.00
ToByteArray Main 123456789012(...)901234567890 [200] ? 13.227 ns 0.0792 ns 1.00 112 B 1.00
ToByteArray PR 123456789012(...)901234567890 [200] ? 15.462 ns 0.0530 ns 1.17 112 B 1.00
Parse Main 123456789012(...)901234567890 [200] ? 904.402 ns 3.3217 ns 1.00 112 B 1.00
Parse PR 123456789012(...)901234567890 [200] ? 913.039 ns 0.5030 ns 1.01 112 B 1.00
ToStringX Main 123456789012(...)901234567890 [200] ? 194.407 ns 2.0091 ns 1.00 360 B 1.00
ToStringX PR 123456789012(...)901234567890 [200] ? 197.276 ns 0.7874 ns 1.01 360 B 1.00
ToStringD Main 123456789012(...)901234567890 [200] ? 632.461 ns 0.6082 ns 1.00 424 B 1.00
ToStringD PR 123456789012(...)901234567890 [200] ? 639.678 ns 1.4579 ns 1.01 424 B 1.00
Ctor_ByteArray Main 12345678901(...)00000000000 [20000] ? 299.157 ns 5.7040 ns 1.00 8336 B 1.00
Ctor_ByteArray PR 12345678901(...)00000000000 [20000] ? 301.355 ns 5.9802 ns 1.01 8336 B 1.00
ToByteArray Main 12345678901(...)00000000000 [20000] ? 295.659 ns 6.0028 ns 1.00 8336 B 1.00
ToByteArray PR 12345678901(...)00000000000 [20000] ? 301.114 ns 5.8015 ns 1.02 8336 B 1.00
Parse Main 12345678901(...)00000000000 [20000] ? 509,953.172 ns 397.2508 ns 1.00 8467 B 1.00
Parse PR 12345678901(...)00000000000 [20000] ? 325,485.743 ns 1,030.2229 ns 0.64 8420 B 0.99
ToStringX Main 12345678901(...)00000000000 [20000] ? 11,990.782 ns 38.1329 ns 1.00 33252 B 1.00
ToStringX PR 12345678901(...)00000000000 [20000] ? 12,153.584 ns 228.8497 ns 1.01 33252 B 1.00
ToStringD Main 12345678901(...)00000000000 [20000] ? 1,166,843.945 ns 2,492.9779 ns 1.00 40169 B 1.00
ToStringD PR 12345678901(...)00000000000 [20000] ? 555,557.235 ns 1,544.7395 ns 0.48 40168 B 1.00
Ctor_ByteArray Main 12345678901(...)01234567890 [20000] ? 313.345 ns 5.1191 ns 1.00 8336 B 1.00
Ctor_ByteArray PR 12345678901(...)01234567890 [20000] ? 297.565 ns 4.8224 ns 0.95 8336 B 1.00
ToByteArray Main 12345678901(...)01234567890 [20000] ? 293.500 ns 3.3923 ns 1.00 8336 B 1.00
ToByteArray PR 12345678901(...)01234567890 [20000] ? 304.539 ns 5.7203 ns 1.04 8336 B 1.00
Parse Main 12345678901(...)01234567890 [20000] ? 792,573.065 ns 5,155.4873 ns 1.00 8540 B 1.00
Parse PR 12345678901(...)01234567890 [20000] ? 454,400.965 ns 933.6157 ns 0.57 8510 B 1.00
ToStringX Main 12345678901(...)01234567890 [20000] ? 12,001.611 ns 64.4123 ns 1.00 33252 B 1.00
ToStringX PR 12345678901(...)01234567890 [20000] ? 12,033.145 ns 81.6348 ns 1.00 33252 B 1.00
ToStringD Main 12345678901(...)01234567890 [20000] ? 1,590,958.533 ns 3,194.9757 ns 1.00 40226 B 1.00
ToStringD PR 12345678901(...)01234567890 [20000] ? 792,864.504 ns 1,831.0917 ns 0.50 40226 B 1.00
Add Main ? 16,16 bits 3.283 ns 0.0127 ns 1.00 - NA
Add PR ? 16,16 bits 3.483 ns 0.0063 ns 1.06 - NA
Subtract Main ? 16,16 bits 3.285 ns 0.0124 ns 1.00 - NA
Subtract PR ? 16,16 bits 3.279 ns 0.0067 ns 1.00 - NA
GreatestCommonDivisor Main ? 16,16 bits 21.275 ns 0.0053 ns 1.00 - NA
GreatestCommonDivisor PR ? 16,16 bits 21.267 ns 0.0053 ns 1.00 - NA
Multiply Main ? 16,16 bits 3.290 ns 0.0255 ns 1.00 - NA
Multiply PR ? 16,16 bits 3.274 ns 0.0076 ns 1.00 - NA
ModPow Main ? 16,16,16 bits 50.489 ns 0.0227 ns 1.00 - NA
ModPow PR ? 16,16,16 bits 50.766 ns 0.0458 ns 1.01 - NA
Divide Main ? 16,8 bits 11.813 ns 0.0088 ns 1.00 - NA
Divide PR ? 16,8 bits 11.836 ns 0.0217 ns 1.00 - NA
Remainder Main ? 16,8 bits 11.591 ns 0.0487 ns 1.00 - NA
Remainder PR ? 16,8 bits 11.563 ns 0.0312 ns 1.00 - NA
Multiply Main ? 16,8 bits 3.283 ns 0.0106 ns 1.00 - NA
Multiply PR ? 16,8 bits 3.281 ns 0.0080 ns 1.00 - NA
ModPow Main ? 16384,16384,64 bits 1,684,361.060 ns 3,353.1715 ns 1.00 45 B 1.00
ModPow PR ? 16384,16384,64 bits 395,615.981 ns 9,792.8658 ns 0.23 36 B 0.80
Equals Main ? 259 bytes, DiffFirstByte 10.763 ns 0.0825 ns 1.00 - NA
Equals PR ? 259 bytes, DiffFirstByte 2.265 ns 0.0195 ns 0.21 - NA
Equals Main ? 259 bytes, DiffLastByte 5.900 ns 0.1012 ns 1.00 - NA
Equals PR ? 259 bytes, DiffLastByte 5.920 ns 0.0830 ns 1.00 - NA
Equals Main ? 259 bytes, DiffMiddleByte 4.472 ns 0.0198 ns 1.00 - NA
Equals PR ? 259 bytes, DiffMiddleByte 4.452 ns 0.0282 ns 1.00 - NA
Equals Main ? 259 bytes, Same 5.897 ns 0.1070 ns 1.00 - NA
Equals PR ? 259 bytes, Same 5.961 ns 0.0442 ns 1.01 - NA
Divide Main ? 65536,32768 bits 458,984.650 ns 850.9992 ns 1.00 4188 B 1.00
Divide PR ? 65536,32768 bits 272,995.839 ns 371.5273 ns 0.59 4162 B 0.99
Remainder Main ? 65536,32768 bits 474,240.013 ns 2,847.4224 ns 1.00 4181 B 1.00
Remainder PR ? 65536,32768 bits 273,170.792 ns 282.7531 ns 0.58 4154 B 0.99
Multiply Main ? 65536,32768 bits 429,862.079 ns 1,043.3717 ns 1.00 12348 B 1.00
Multiply PR ? 65536,32768 bits 278,142.006 ns 770.2665 ns 0.65 12338 B 1.00
Add Main ? 65536,65536 bits 2,156.120 ns 41.5735 ns 1.00 8224 B 1.00
Add PR ? 65536,65536 bits 1,830.042 ns 25.8593 ns 0.85 8224 B 1.00
Subtract Main ? 65536,65536 bits 2,165.437 ns 42.5933 ns 1.00 8216 B 1.00
Subtract PR ? 65536,65536 bits 1,854.735 ns 37.5420 ns 0.86 8216 B 1.00
GreatestCommonDivisor Main ? 65536,65536 bits 4,089,678.458 ns 2,139.0885 ns 1.00 128 B 1.00
GreatestCommonDivisor PR ? 65536,65536 bits 4,096,067.571 ns 3,200.6518 ns 1.00 128 B 1.00
Multiply Main ? 65536,65536 bits 623,796.634 ns 2,269.6479 ns 1.00 16556 B 1.00
Multiply PR ? 65536,65536 bits 390,767.474 ns 508.9444 ns 0.63 16499 B 1.00
Equals Main ? 67 bytes, DiffFirstByte 2.257 ns 0.0208 ns 1.00 - NA
Equals PR ? 67 bytes, DiffFirstByte 2.260 ns 0.0160 ns 1.00 - NA
Equals Main ? 67 bytes, DiffLastByte 3.335 ns 0.0618 ns 1.00 - NA
Equals PR ? 67 bytes, DiffLastByte 3.342 ns 0.0548 ns 1.00 - NA
Equals Main ? 67 bytes, DiffMiddleByte 2.250 ns 0.0121 ns 1.00 - NA
Equals PR ? 67 bytes, DiffMiddleByte 2.254 ns 0.0167 ns 1.00 - NA
Equals Main ? 67 bytes, Same 3.285 ns 0.0600 ns 1.00 - NA
Equals PR ? 67 bytes, Same 2.805 ns 0.0539 ns 0.85 - NA

Artifacts:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions