Skip to content

Commit

Permalink
Updated benchmarks.
Browse files Browse the repository at this point in the history
  • Loading branch information
DJGosnell committed Apr 13, 2022
1 parent 847d902 commit 597b3f7
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 56 deletions.
42 changes: 23 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,32 @@ var hashValue = algorithm.FinalizeHash();



#### Benchmarks
#### [Benchmarks](docs/Benchmarks/DtronixHash.Benchmarks.MurMur3Benchmark.md)

``` ini
BenchmarkDotNet=v0.12.1, OS=Windows 10.0.19044
Intel Core i7-10700 CPU 2.90GHz, 1 CPU, 16 logical and 8 physical cores
.NET Core SDK=5.0.200
.NET Core SDK=6.0.201
[Host] : .NET Core 6.0.3 (CoreCLR 6.0.322.12309, CoreFX 6.0.322.12309), X64 RyuJIT
DefaultJob : .NET Core 6.0.3 (CoreCLR 6.0.322.12309, CoreFX 6.0.322.12309), X64 RyuJIT
```
| Method | Data (KB) | MBps | Gen 0 | Gen 1 | Gen 2 | Allocated |
| :--------------------------- | --------------- | ----------: | ---------: | ----: | ----: | --------: |
| **ComputeMurMur3Hash128X64** | **1,000** | **3,609.0** | **0.0048** | **-** | **-** | **40 B** |
| **ComputeMurMur3Hash128X86** | **1,000** | **2,666.1** | **0.0048** | **-** | **-** | **40 B** |
| ComputeMd5 | 1,000 | 527.9 | 0.0095 | - | - | 80 B |
| ComputeSha256 | 1,000 | 255.2 | 0.0114 | - | - | 112 B |
| ComputeSha1 | 1,000 | 620.5 | 0.0114 | - | - | 96 B |
| **ComputeMurMur3Hash128X64** | **100,000** | **5,513.4** | **-** | **-** | **-** | **40 B** |
| **ComputeMurMur3Hash128X86** | **100,000** | **3,639.6** | **-** | **-** | **-** | **40 B** |
| ComputeMd5 | 100,000 | 582.3 | - | - | - | 80 B |
| ComputeSha256 | 100,000 | 277.9 | - | - | - | 112 B |
| ComputeSha1 | 100,000 | 715.6 | - | - | - | 96 B |
| **ComputeMurMur3Hash128X64** | **100,000,000** | **4,820.6** | **-** | **-** | **-** | **40 B** |
| **ComputeMurMur3Hash128X86** | **100,000,000** | **3,320.4** | **-** | **-** | **-** | **40 B** |
| ComputeMd5 | 100,000,000 | 578.9 | - | - | - | 228 B |
| ComputeSha256 | 100,000,000 | 276.3 | - | - | - | 112 B |
| ComputeSha1 | 100,000,000 | 702.1 | - | - | - | 96 B |
| Method | DataSize | MBps | Gen 0 | Gen 1 | Gen 2 | Allocated |
| ---------------------------- | ------------- | ----------- | ----------:| -----:| -----:| ---------:|
| **ComputeMurMur3Hash128X64** | **1000** | **3,793.9** | **0.0048** | **-** | **-** | **40 B** |
| ComputeMurMur3Hash128X86 | 1000 | 2,801.7 | 0.0048 | - | - | 40 B |
| ComputeMd5 | 1000 | 573.7 | 0.0095 | - | - | 80 B |
| ComputeSha256 | 1000 | 252.7 | 0.0114 | - | - | 112 B |
| ComputeSha1 | 1000 | 611.4 | 0.0114 | - | - | 96 B |
| **ComputeMurMur3Hash128X64** | **100000** | **5,665.4** | **-** | **-** | **-** | **40 B** |
| ComputeMurMur3Hash128X86 | 100000 | 3,717.0 | - | - | - | 40 B |
| ComputeMd5 | 100000 | 637.4 | - | - | - | 80 B |
| ComputeSha256 | 100000 | 274.8 | - | - | - | 112 B |
| ComputeSha1 | 100000 | 710.5 | - | - | - | 96 B |
| **ComputeMurMur3Hash128X64** | **100000000** | **5,054.7** | **-** | **-** | **-** | **56 B** |
| ComputeMurMur3Hash128X86 | 100000000 | 3,455.2 | - | - | - | 56 B |
| ComputeMd5 | 100000000 | 630.7 | - | - | - | 400 B |
| ComputeSha256 | 100000000 | 274.3 | - | - | - | 2256 B |
| ComputeSha1 | 100000000 | 701.2 | - | - | - | 216 B |

#### License

Expand Down
74 changes: 37 additions & 37 deletions docs/Benchmarks/DtronixHash.Benchmarks.MurMur3Benchmark.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
``` ini
BenchmarkDotNet=v0.12.1, OS=Windows 10.0.19042
```ini
BenchmarkDotNet=v0.12.1, OS=Windows 10.0.19044
Intel Core i7-10700 CPU 2.90GHz, 1 CPU, 16 logical and 8 physical cores
.NET Core SDK=5.0.200
[Host] : .NET Core 5.0.3 (CoreCLR 5.0.321.7212, CoreFX 5.0.321.7212), X64 RyuJIT
DefaultJob : .NET Core 5.0.3 (CoreCLR 5.0.321.7212, CoreFX 5.0.321.7212), X64 RyuJIT
.NET Core SDK=6.0.201
[Host] : .NET Core 6.0.3 (CoreCLR 6.0.322.12309, CoreFX 6.0.322.12309), X64 RyuJIT
DefaultJob : .NET Core 6.0.3 (CoreCLR 6.0.322.12309, CoreFX 6.0.322.12309), X64 RyuJIT
```
| Method | DataSize | Mean | Error | StdDev | MBps | Gen 0 | Gen 1 | Gen 2 | Allocated |
| ---------------------------- | ------------- | ------------------: | ---------------: | ---------------: | ----------- | ---------: | ----: | ----: | --------: |
| **ComputeMurMur3Hash128X64** | **1000** | **264.2 ns** | **0.82 ns** | **0.77 ns** | **3,609.0** | **0.0048** | **-** | **-** | **40 B** |
| ComputeMurMur3Hash128X86 | 1000 | 357.7 ns | 1.68 ns | 1.49 ns | 2,666.1 | 0.0048 | - | - | 40 B |
| ComputeMd5 | 1000 | 1,806.6 ns | 9.07 ns | 8.48 ns | 527.9 | 0.0095 | - | - | 80 B |
| ComputeSha256 | 1000 | 3,737.0 ns | 12.18 ns | 11.39 ns | 255.2 | 0.0114 | - | - | 112 B |
| ComputeSha1 | 1000 | 1,536.9 ns | 2.49 ns | 1.95 ns | 620.5 | 0.0114 | - | - | 96 B |
| BufferMurMur3Hash128X64 | 1000 | 327.7 ns | 0.60 ns | 0.53 ns | 2,909.8 | 0.0153 | - | - | 128 B |
| BufferMurMur3Hash128X86 | 1000 | 428.5 ns | 3.18 ns | 2.98 ns | 2,225.5 | 0.0153 | - | - | 128 B |
| BufferMd5 | 1000 | 1,896.0 ns | 6.70 ns | 5.23 ns | 503.0 | 0.0153 | - | - | 144 B |
| BufferSha256 | 1000 | 3,870.9 ns | 11.83 ns | 10.48 ns | 246.4 | 0.0153 | - | - | 176 B |
| BufferSha1 | 1000 | 1,630.9 ns | 3.34 ns | 3.12 ns | 584.7 | 0.0191 | - | - | 160 B |
| **ComputeMurMur3Hash128X64** | **100000** | **17,297.4 ns** | **57.56 ns** | **53.84 ns** | **5,513.4** | **-** | **-** | **-** | **40 B** |
| ComputeMurMur3Hash128X86 | 100000 | 26,202.9 ns | 108.71 ns | 90.77 ns | 3,639.6 | - | - | - | 40 B |
| ComputeMd5 | 100000 | 163,763.8 ns | 87.95 ns | 82.27 ns | 582.3 | - | - | - | 80 B |
| ComputeSha256 | 100000 | 343,195.9 ns | 403.93 ns | 358.07 ns | 277.9 | - | - | - | 112 B |
| ComputeSha1 | 100000 | 133,268.1 ns | 319.94 ns | 283.62 ns | 715.6 | - | - | - | 96 B |
| BufferMurMur3Hash128X64 | 100000 | 18,434.8 ns | 27.59 ns | 25.81 ns | 5,173.2 | - | - | - | 128 B |
| BufferMurMur3Hash128X86 | 100000 | 26,934.5 ns | 155.81 ns | 145.74 ns | 3,540.7 | - | - | - | 128 B |
| BufferMd5 | 100000 | 166,770.1 ns | 148.05 ns | 123.63 ns | 571.8 | - | - | - | 144 B |
| BufferSha256 | 100000 | 349,367.0 ns | 998.88 ns | 885.48 ns | 273.0 | - | - | - | 176 B |
| BufferSha1 | 100000 | 137,391.2 ns | 900.96 ns | 842.76 ns | 694.1 | - | - | - | 160 B |
| **ComputeMurMur3Hash128X64** | **100000000** | **19,783,309.4 ns** | **58,753.20 ns** | **52,083.18 ns** | **4,820.6** | **-** | **-** | **-** | **40 B** |
| ComputeMurMur3Hash128X86 | 100000000 | 28,722,043.3 ns | 67,295.13 ns | 62,947.90 ns | 3,320.4 | - | - | - | 40 B |
| ComputeMd5 | 100000000 | 164,732,026.8 ns | 515,098.07 ns | 456,621.02 ns | 578.9 | - | - | - | 228 B |
| ComputeSha256 | 100000000 | 345,219,293.3 ns | 1,846,320.62 ns | 1,727,049.46 ns | 276.3 | - | - | - | 112 B |
| ComputeSha1 | 100000000 | 135,827,603.6 ns | 1,090,969.37 ns | 967,115.93 ns | 702.1 | - | - | - | 96 B |
| BufferMurMur3Hash128X64 | 100000000 | 21,020,943.5 ns | 61,046.69 ns | 57,103.11 ns | 4,536.8 | - | - | - | 128 B |
| BufferMurMur3Hash128X86 | 100000000 | 29,493,213.5 ns | 113,097.65 ns | 94,441.66 ns | 3,233.5 | - | - | - | 128 B |
| BufferMd5 | 100000000 | 170,801,655.6 ns | 288,446.01 ns | 269,812.58 ns | 558.4 | - | - | - | 1053 B |
| BufferSha256 | 100000000 | 351,690,193.3 ns | 774,130.95 ns | 724,122.57 ns | 271.2 | - | - | - | 464 B |
| BufferSha1 | 100000000 | 140,112,348.3 ns | 440,737.74 ns | 412,266.35 ns | 680.6 | - | - | - | 544 B |
| Method | DataSize | Mean | Error | StdDev | MBps | Gen 0 | Gen 1 | Gen 2 | Allocated |
| ---------------------------- | ------------- | -------------------:| ----------------:| ----------------:| ----------- | ----------:| -----:| -----:| ---------:|
| **ComputeMurMur3Hash128X64** | **1000** | **251.4 ns** | **0.35 ns** | **0.32 ns** | **3,793.9** | **0.0048** | **-** | **-** | **40 B** |
| ComputeMurMur3Hash128X86 | 1000 | 340.4 ns | 1.29 ns | 1.15 ns | 2,801.7 | 0.0048 | - | - | 40 B |
| ComputeMd5 | 1000 | 1,662.4 ns | 1.18 ns | 1.11 ns | 573.7 | 0.0095 | - | - | 80 B |
| ComputeSha256 | 1000 | 3,773.9 ns | 0.50 ns | 0.44 ns | 252.7 | 0.0114 | - | - | 112 B |
| ComputeSha1 | 1000 | 1,559.8 ns | 4.30 ns | 3.59 ns | 611.4 | 0.0114 | - | - | 96 B |
| BufferMurMur3Hash128X64 | 1000 | 317.3 ns | 0.39 ns | 0.36 ns | 3,005.9 | 0.0153 | - | - | 128 B |
| BufferMurMur3Hash128X86 | 1000 | 407.7 ns | 1.16 ns | 1.09 ns | 2,339.0 | 0.0153 | - | - | 128 B |
| BufferMd5 | 1000 | 1,745.0 ns | 1.16 ns | 1.08 ns | 546.5 | 0.0172 | - | - | 144 B |
| BufferSha256 | 1000 | 3,894.4 ns | 2.35 ns | 1.83 ns | 244.9 | 0.0153 | - | - | 176 B |
| BufferSha1 | 1000 | 1,651.6 ns | 0.56 ns | 0.53 ns | 577.4 | 0.0191 | - | - | 160 B |
| **ComputeMurMur3Hash128X64** | **100000** | **16,833.3 ns** | **31.55 ns** | **29.52 ns** | **5,665.4** | **-** | **-** | **-** | **40 B** |
| ComputeMurMur3Hash128X86 | 100000 | 25,656.8 ns | 85.30 ns | 79.79 ns | 3,717.0 | - | - | - | 40 B |
| ComputeMd5 | 100000 | 149,612.0 ns | 64.90 ns | 57.53 ns | 637.4 | - | - | - | 80 B |
| ComputeSha256 | 100000 | 347,106.0 ns | 705.26 ns | 659.70 ns | 274.8 | - | - | - | 112 B |
| ComputeSha1 | 100000 | 134,233.8 ns | 186.14 ns | 174.11 ns | 710.5 | - | - | - | 96 B |
| BufferMurMur3Hash128X64 | 100000 | 17,793.2 ns | 29.95 ns | 28.01 ns | 5,359.8 | - | - | - | 128 B |
| BufferMurMur3Hash128X86 | 100000 | 26,686.8 ns | 135.52 ns | 126.76 ns | 3,573.6 | - | - | - | 128 B |
| BufferMd5 | 100000 | 153,260.4 ns | 348.20 ns | 290.76 ns | 622.3 | - | - | - | 144 B |
| BufferSha256 | 100000 | 352,645.7 ns | 161.83 ns | 151.38 ns | 270.4 | - | - | - | 176 B |
| BufferSha1 | 100000 | 137,859.0 ns | 120.37 ns | 112.59 ns | 691.8 | - | - | - | 160 B |
| **ComputeMurMur3Hash128X64** | **100000000** | **18,867,203.3 ns** | **34,723.27 ns** | **32,480.17 ns** | **5,054.7** | **-** | **-** | **-** | **56 B** |
| ComputeMurMur3Hash128X86 | 100000000 | 27,600,964.7 ns | 43,010.38 ns | 35,915.62 ns | 3,455.2 | - | - | - | 56 B |
| ComputeMd5 | 100000000 | 151,203,051.8 ns | 129,673.75 ns | 114,952.40 ns | 630.7 | - | - | - | 400 B |
| ComputeSha256 | 100000000 | 347,636,746.7 ns | 316,817.39 ns | 296,351.18 ns | 274.3 | - | - | - | 2256 B |
| ComputeSha1 | 100000000 | 136,010,220.0 ns | 100,147.87 ns | 93,678.38 ns | 701.2 | - | - | - | 216 B |
| BufferMurMur3Hash128X64 | 100000000 | 19,641,306.7 ns | 33,838.33 ns | 31,652.40 ns | 4,855.5 | - | - | - | 143 B |
| BufferMurMur3Hash128X86 | 100000000 | 28,543,796.4 ns | 69,230.32 ns | 61,370.87 ns | 3,341.1 | - | - | - | 144 B |
| BufferMd5 | 100000000 | 159,044,839.3 ns | 26,631.12 ns | 23,607.79 ns | 599.6 | - | - | - | 788 B |
| BufferSha256 | 100000000 | 358,024,935.7 ns | 106,814.50 ns | 94,688.27 ns | 266.4 | - | - | - | 992 B |
| BufferSha1 | 100000000 | 144,255,541.7 ns | 179,343.54 ns | 167,758.06 ns | 661.1 | - | - | - | 804 B |

0 comments on commit 597b3f7

Please sign in to comment.