Skip to content

Benchmarks

Roman Bukin edited this page Nov 18, 2025 · 7 revisions

How to run benchmarks

cd ./src/Dodo.Primitives.Benchmarks
dotnet run -c Release

Benchmark results

BenchmarkDotNet v0.15.6, Windows 11 (10.0.26200.7171)
AMD Ryzen 9 9950X 4.30GHz, 1 CPU, 32 logical and 16 physical cores
.NET SDK 10.0.100
  [Host]     : .NET 10.0.0 (10.0.0, 10.0.25.52411), X64 RyuJIT x86-64-v4
  Job-UFXZUX : .NET 10.0.0 (10.0.0, 10.0.25.52411), X64 RyuJIT x86-64-v4

Server=True  

1ns = 1s / 1 000 000 000

ToString

Method Mean Error StdDev Gen0 Allocated
guid_ToString_N 6.543 ns 0.0654 ns 0.0579 ns 0.0011 88 B
uuid_ToString_N 7.793 ns 0.0397 ns 0.0332 ns 0.0011 88 B
guid_ToString_D 7.771 ns 0.0283 ns 0.0221 ns 0.0013 96 B
uuid_ToString_D 9.090 ns 0.0467 ns 0.0437 ns 0.0013 96 B
guid_ToString_B 9.362 ns 0.1678 ns 0.1569 ns 0.0014 104 B
uuid_ToString_B 9.235 ns 0.0393 ns 0.0368 ns 0.0014 104 B
guid_ToString_P 7.979 ns 0.0795 ns 0.0705 ns 0.0014 104 B
uuid_ToString_P 9.288 ns 0.0926 ns 0.0773 ns 0.0014 104 B
guid_ToString_X 19.979 ns 0.1024 ns 0.0958 ns 0.0021 160 B
uuid_ToString_X 12.645 ns 0.0733 ns 0.0686 ns 0.0021 160 B

TryParse

Method Mean Error StdDev Median Allocated
guid_TryParse_N 20.267 ns 0.0517 ns 0.0432 ns 20.261 ns -
uuid_TryParse_N 8.126 ns 0.1605 ns 0.1718 ns 8.133 ns -
guid_TryParse_D 22.619 ns 0.0651 ns 0.0577 ns 22.628 ns -
uuid_TryParse_D 8.921 ns 0.4390 ns 1.2943 ns 10.032 ns -
guid_TryParse_B 14.564 ns 0.0151 ns 0.0126 ns 14.564 ns -
uuid_TryParse_B 7.948 ns 0.1892 ns 0.5580 ns 7.562 ns -
guid_TryParse_P 14.546 ns 0.0314 ns 0.0278 ns 14.545 ns -
uuid_TryParse_P 7.450 ns 0.1852 ns 0.5460 ns 7.822 ns -
guid_TryParse_X 52.717 ns 0.1746 ns 0.1458 ns 52.713 ns -
uuid_TryParse_X 9.720 ns 0.0483 ns 0.0404 ns 9.726 ns -

Ctor

Method Mean Error StdDev Allocated
guid_CtorReadOnlySpan 0.0012 ns 0.0001 ns 0.0001 ns -
uuid_CtorReadOnlySpan 0.0119 ns 0.0001 ns 0.0001 ns -
guid_CtorByteArray 0.0419 ns 0.0013 ns 0.0012 ns -
uuid_CtorByteArray 0.0600 ns 0.0022 ns 0.0020 ns -

Overrides

Method Mean Error StdDev Median Allocated
guid_EqualsDifferentTypesValues 0.0138 ns 0.0028 ns 0.0025 ns 0.0137 ns -
uuid_EqualsDifferentTypesValues 0.0097 ns 0.0037 ns 0.0035 ns 0.0100 ns -
guid_EqualsWithNull 0.0000 ns 0.0001 ns 0.0001 ns 0.0000 ns -
uuid_EqualsWithNull 0.0000 ns 0.0000 ns 0.0000 ns 0.0000 ns -
guid_EqualsWithSameValueObject 0.0218 ns 0.0022 ns 0.0021 ns 0.0213 ns -
uuid_EqualsWithSameValueObject 0.0161 ns 0.0022 ns 0.0021 ns 0.0153 ns -
guid_GetHashCode 0.0158 ns 0.0019 ns 0.0017 ns 0.0164 ns -
uuid_GetHashCode 0.0164 ns 0.0017 ns 0.0016 ns 0.0162 ns -

Generator

Method Mean Error StdDev Allocated
guid_CreateVersion7 53.46 ns 0.122 ns 0.114 ns -
uuid_CreateVersion7 56.56 ns 0.036 ns 0.033 ns -

Implemented interfaces

Method Mean Error StdDev Median Allocated
guid_CompareTo_T_DifferentValue 0.0128 ns 0.0022 ns 0.0020 ns 0.0129 ns -
uuid_CompareTo_T_DifferentValue 0.0107 ns 0.0016 ns 0.0015 ns 0.0114 ns -
guid_CompareToDifferentValueObject 0.8385 ns 0.0026 ns 0.0024 ns 0.8387 ns -
uuid_CompareToDifferentValueObject 1.3240 ns 0.0045 ns 0.0040 ns 1.3256 ns -
guid_CompareToNull 0.0005 ns 0.0009 ns 0.0007 ns 0.0004 ns -
uuid_CompareToNull 0.0033 ns 0.0066 ns 0.0055 ns 0.0000 ns -
guid_CompareToSameValueObject 1.5187 ns 0.0064 ns 0.0057 ns 1.5192 ns -
uuid_CompareToSameValueObject 2.6469 ns 0.0062 ns 0.0055 ns 2.6473 ns -
guid_CompareTo_T_SameValue 1.5330 ns 0.0041 ns 0.0037 ns 1.5340 ns -
uuid_CompareTo_T_SameValue 2.3491 ns 0.0045 ns 0.0040 ns 2.3493 ns -
guid_EqualsDifferent 0.0106 ns 0.0011 ns 0.0010 ns 0.0108 ns -
uuid_EqualsDifferent 0.0124 ns 0.0019 ns 0.0017 ns 0.0131 ns -
guid_EqualsSame 0.0107 ns 0.0014 ns 0.0013 ns 0.0111 ns -
uuid_EqualsSame 0.0111 ns 0.0016 ns 0.0014 ns 0.0114 ns -

Instance methods

Method Mean Error StdDev Gen0 Allocated
guid_ToByteArray 2.7513 ns 0.0319 ns 0.0266 ns 0.0005 40 B
uuid_ToByteArray 2.7383 ns 0.0340 ns 0.0301 ns 0.0005 40 B
guid_TryWriteBytes 0.1078 ns 0.0017 ns 0.0014 ns - -
uuid_TryWriteBytes 0.1113 ns 0.0020 ns 0.0018 ns - -

Clone this wiki locally