Skip to content

Commit

Permalink
improved benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
protobufel committed May 31, 2017
1 parent 1a7afa2 commit 2c841da
Show file tree
Hide file tree
Showing 8 changed files with 276 additions and 99 deletions.
8 changes: 4 additions & 4 deletions MultiKeyMap/MultiKeyMap.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
<RepositoryUrl>https://github.com/protobufel/multikeymapcsharp</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>c# library multikey dictionary</PackageTags>
<PackageReleaseNotes>Added benchmarks</PackageReleaseNotes>
<PackageReleaseNotes>improved benchmarks</PackageReleaseNotes>
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<SignAssembly>False</SignAssembly>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<FileVersion>4.0.10.0</FileVersion>
<Version>4.0.10</Version>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<FileVersion>4.0.20.0</FileVersion>
<Version>4.0.20</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
``` ini

BenchmarkDotNet=v0.10.6, OS=Windows 10 Redstone 2 (10.0.15063)
Processor=Intel Core i7-4790 CPU 3.60GHz (Haswell), ProcessorCount=8
Frequency=3507520 Hz, Resolution=285.1017 ns, Timer=TSC
dotnet cli version=1.0.4
[Host] : .NET Core 4.6.25211.01, 64bit RyuJIT
DefaultJob : .NET Core 4.6.25211.01, 64bit RyuJIT


```
| Method | Strategy | Mean | Error | StdDev | Scaled | ScaledSD | Gen 0 | Gen 1 | Allocated |
|-------------------------------------------------------- |-------------------------------- |-------------:|-----------:|------------:|-------:|---------:|---------:|-------:|----------:|
| **MultiKeyMap_TryGetFullKeysByPartialKey** | **OptimizedForNonPositionalSearch** | **3,993.835 us** | **76.0634 us** | **71.1497 us** | **774.55** | **13.91** | **136.7188** | **7.8125** | **587864 B** |
| MultiKeyMap_Mixed_Positional_TryGetFullKeysByPartialKey | OptimizedForNonPositionalSearch | 2,087.965 us | 19.9784 us | 17.7103 us | 404.93 | 3.90 | 85.9375 | - | 360464 B |
| MultiKeyMap_Only_Positional_TryGetFullKeysByPartialKey | OptimizedForNonPositionalSearch | 1,383.378 us | 6.2410 us | 5.5325 us | 268.29 | 1.72 | 64.4531 | - | 272904 B |
| Dictionary_TryGetValue | OptimizedForNonPositionalSearch | 5.156 us | 0.0291 us | 0.0273 us | 1.00 | 0.00 | 0.2136 | - | 904 B |
| **MultiKeyMap_TryGetFullKeysByPartialKey** | **OptimizedForPositionalSearch** | **5,061.886 us** | **98.8395 us** | **138.5592 us** | **955.39** | **28.78** | **335.9375** | **-** | **1427440 B** |
| MultiKeyMap_Mixed_Positional_TryGetFullKeysByPartialKey | OptimizedForPositionalSearch | 2,726.744 us | 7.7777 us | 5.6238 us | 514.65 | 7.08 | 187.5000 | - | 786576 B |
| MultiKeyMap_Only_Positional_TryGetFullKeysByPartialKey | OptimizedForPositionalSearch | 535.473 us | 2.0084 us | 1.8787 us | 101.07 | 1.42 | 33.2031 | - | 142424 B |
| Dictionary_TryGetValue | OptimizedForPositionalSearch | 5.299 us | 0.0863 us | 0.0765 us | 1.00 | 0.00 | 0.2136 | - | 904 B |
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Method,Job,AnalyzeLaunchVariance,EvaluateOverhead,MaxAbsoluteError,MaxRelativeError,MinInvokeCount,MinIterationTime,RemoveOutliers,Affinity,Jit,Platform,Runtime,AllowVeryLargeObjects,Concurrent,CpuGroups,Force,RetainVm,Server,Clock,EngineFactory,Toolchain,InvocationCount,IterationTime,LaunchCount,RunStrategy,TargetCount,UnrollFactor,WarmupCount,Strategy,Mean,Error,StdDev,Scaled,ScaledSD,Gen 0,Gen 1,Allocated
MultiKeyMap_TryGetFullKeysByPartialKey,Default,False,Default,Default,Default,Default,Default,Default,255,RyuJit,X64,Core,False,True,False,True,False,False,Default,Default,Default,1,Default,Default,Default,Default,16,Default,OptimizedForNonPositionalSearch,"3,993.835 us",76.0634 us,71.1497 us,774.55,13.91,136.7188,7.8125,587864 B
MultiKeyMap_Mixed_Positional_TryGetFullKeysByPartialKey,Default,False,Default,Default,Default,Default,Default,Default,255,RyuJit,X64,Core,False,True,False,True,False,False,Default,Default,Default,1,Default,Default,Default,Default,16,Default,OptimizedForNonPositionalSearch,"2,087.965 us",19.9784 us,17.7103 us,404.93,3.90,85.9375,-,360464 B
MultiKeyMap_Only_Positional_TryGetFullKeysByPartialKey,Default,False,Default,Default,Default,Default,Default,Default,255,RyuJit,X64,Core,False,True,False,True,False,False,Default,Default,Default,1,Default,Default,Default,Default,16,Default,OptimizedForNonPositionalSearch,"1,383.378 us",6.2410 us,5.5325 us,268.29,1.72,64.4531,-,272904 B
Dictionary_TryGetValue,Default,False,Default,Default,Default,Default,Default,Default,255,RyuJit,X64,Core,False,True,False,True,False,False,Default,Default,Default,1,Default,Default,Default,Default,16,Default,OptimizedForNonPositionalSearch,5.156 us,0.0291 us,0.0273 us,1.00,0.00,0.2136,-,904 B
MultiKeyMap_TryGetFullKeysByPartialKey,Default,False,Default,Default,Default,Default,Default,Default,255,RyuJit,X64,Core,False,True,False,True,False,False,Default,Default,Default,1,Default,Default,Default,Default,16,Default,OptimizedForPositionalSearch,"5,061.886 us",98.8395 us,138.5592 us,955.39,28.78,335.9375,-,1427440 B
MultiKeyMap_Mixed_Positional_TryGetFullKeysByPartialKey,Default,False,Default,Default,Default,Default,Default,Default,255,RyuJit,X64,Core,False,True,False,True,False,False,Default,Default,Default,1,Default,Default,Default,Default,16,Default,OptimizedForPositionalSearch,"2,726.744 us",7.7777 us,5.6238 us,514.65,7.08,187.5000,-,786576 B
MultiKeyMap_Only_Positional_TryGetFullKeysByPartialKey,Default,False,Default,Default,Default,Default,Default,Default,255,RyuJit,X64,Core,False,True,False,True,False,False,Default,Default,Default,1,Default,Default,Default,Default,16,Default,OptimizedForPositionalSearch,535.473 us,2.0084 us,1.8787 us,101.07,1.42,33.2031,-,142424 B
Dictionary_TryGetValue,Default,False,Default,Default,Default,Default,Default,Default,255,RyuJit,X64,Core,False,True,False,True,False,False,Default,Default,Default,1,Default,Default,Default,Default,16,Default,OptimizedForPositionalSearch,5.299 us,0.0863 us,0.0765 us,1.00,0.00,0.2136,-,904 B
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='utf-8' />
<title>MultiKeyMapVsDictionaryTryGetsByPartialKeyStrings</title>

<style type="text/css">
table { border-collapse: collapse; display: block; width: 100%; overflow: auto; }
td, th { padding: 6px 13px; border: 1px solid #ddd; }
tr { background-color: #fff; border-top: 1px solid #ccc; }
tr:nth-child(even) { background: #f8f8f8; }
</style>
</head>
<body>
<pre><code>
BenchmarkDotNet=v0.10.6, OS=Windows 10 Redstone 2 (10.0.15063)
Processor=Intel Core i7-4790 CPU 3.60GHz (Haswell), ProcessorCount=8
Frequency=3507520 Hz, Resolution=285.1017 ns, Timer=TSC
dotnet cli version=1.0.4
[Host] : .NET Core 4.6.25211.01, 64bit RyuJIT
DefaultJob : .NET Core 4.6.25211.01, 64bit RyuJIT
</code></pre>
<pre><code></code></pre>

<table>
<thead><tr><th> Method</th><th> Strategy</th><th> Mean</th><th>Error</th><th>StdDev</th><th>Scaled</th><th>ScaledSD</th><th>Gen 0</th><th>Gen 1</th><th>Allocated</th>
</tr>
</thead><tbody><tr><td> MultiKeyMap_TryGetFullKeysByPartialKey</td><td>OptimizedForNonPositionalSearch</td><td>3,993.835 us</td><td>76.0634 us</td><td>71.1497 us</td><td>774.55</td><td>13.91</td><td>136.7188</td><td>7.8125</td><td>587864 B</td>
</tr><tr><td>MultiKeyMap_Mixed_Positional_TryGetFullKeysByPartialKey</td><td>OptimizedForNonPositionalSearch</td><td>2,087.965 us</td><td>19.9784 us</td><td>17.7103 us</td><td>404.93</td><td>3.90</td><td>85.9375</td><td>-</td><td>360464 B</td>
</tr><tr><td>MultiKeyMap_Only_Positional_TryGetFullKeysByPartialKey</td><td>OptimizedForNonPositionalSearch</td><td>1,383.378 us</td><td>6.2410 us</td><td>5.5325 us</td><td>268.29</td><td>1.72</td><td>64.4531</td><td>-</td><td>272904 B</td>
</tr><tr><td> Dictionary_TryGetValue</td><td>OptimizedForNonPositionalSearch</td><td>5.156 us</td><td>0.0291 us</td><td>0.0273 us</td><td>1.00</td><td>0.00</td><td>0.2136</td><td>-</td><td>904 B</td>
</tr><tr><td> MultiKeyMap_TryGetFullKeysByPartialKey</td><td>OptimizedForPositionalSearch</td><td>5,061.886 us</td><td>98.8395 us</td><td>138.5592 us</td><td>955.39</td><td>28.78</td><td>335.9375</td><td>-</td><td>1427440 B</td>
</tr><tr><td>MultiKeyMap_Mixed_Positional_TryGetFullKeysByPartialKey</td><td>OptimizedForPositionalSearch</td><td>2,726.744 us</td><td>7.7777 us</td><td>5.6238 us</td><td>514.65</td><td>7.08</td><td>187.5000</td><td>-</td><td>786576 B</td>
</tr><tr><td>MultiKeyMap_Only_Positional_TryGetFullKeysByPartialKey</td><td>OptimizedForPositionalSearch</td><td>535.473 us</td><td>2.0084 us</td><td>1.8787 us</td><td>101.07</td><td>1.42</td><td>33.2031</td><td>-</td><td>142424 B</td>
</tr><tr><td> Dictionary_TryGetValue</td><td>OptimizedForPositionalSearch</td><td>5.299 us</td><td>0.0863 us</td><td>0.0765 us</td><td>1.00</td><td>0.00</td><td>0.2136</td><td>-</td><td>904 B</td>
</tr></tbody></table>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
``` ini

BenchmarkDotNet=v0.10.6, OS=Windows 10 Redstone 2 (10.0.15063)
Processor=Intel Core i7-4790 CPU 3.60GHz (Haswell), ProcessorCount=8
Frequency=3507520 Hz, Resolution=285.1017 ns, Timer=TSC
dotnet cli version=1.0.4
[Host] : .NET Core 4.6.25211.01, 64bit RyuJIT
DefaultJob : .NET Core 4.6.25211.01, 64bit RyuJIT


```
| Method | Strategy | Mean | Error | StdDev | Scaled | ScaledSD | Gen 0 | Allocated |
|-------------------------------------------------------- |-------------------------------- |------------:|-----------:|-----------:|-------:|---------:|-------:|----------:|
| **MultiKeyMap_TryGetFullKeysByPartialKey** | **OptimizedForNonPositionalSearch** | **5,176.8 ns** | **35.2651 ns** | **32.9870 ns** | **39.87** | **0.26** | **0.2594** | **1112 B** |
| MultiKeyMap_Mixed_Positional_TryGetFullKeysByPartialKey | OptimizedForNonPositionalSearch | 8,644.0 ns | 41.3801 ns | 38.7070 ns | 66.57 | 0.33 | 0.4883 | 2056 B |
| MultiKeyMap_Only_Positional_TryGetFullKeysByPartialKey | OptimizedForNonPositionalSearch | 10,103.6 ns | 21.8971 ns | 20.4825 ns | 77.81 | 0.23 | 0.6409 | 2720 B |
| Dictionary_TryGetValue | OptimizedForNonPositionalSearch | 129.8 ns | 0.3481 ns | 0.3086 ns | 1.00 | 0.00 | 0.0303 | 128 B |
| **MultiKeyMap_TryGetFullKeysByPartialKey** | **OptimizedForPositionalSearch** | **14,046.4 ns** | **45.8984 ns** | **40.6877 ns** | **107.24** | **0.41** | **1.8921** | **8024 B** |
| MultiKeyMap_Mixed_Positional_TryGetFullKeysByPartialKey | OptimizedForPositionalSearch | 12,917.5 ns | 28.6502 ns | 23.9242 ns | 98.62 | 0.31 | 1.2054 | 5104 B |
| MultiKeyMap_Only_Positional_TryGetFullKeysByPartialKey | OptimizedForPositionalSearch | 3,074.5 ns | 6.0024 ns | 5.0123 ns | 23.47 | 0.07 | 0.2975 | 1256 B |
| Dictionary_TryGetValue | OptimizedForPositionalSearch | 131.0 ns | 0.3932 ns | 0.3485 ns | 1.00 | 0.00 | 0.0303 | 128 B |
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Method,Job,AnalyzeLaunchVariance,EvaluateOverhead,MaxAbsoluteError,MaxRelativeError,MinInvokeCount,MinIterationTime,RemoveOutliers,Affinity,Jit,Platform,Runtime,AllowVeryLargeObjects,Concurrent,CpuGroups,Force,RetainVm,Server,Clock,EngineFactory,Toolchain,InvocationCount,IterationTime,LaunchCount,RunStrategy,TargetCount,UnrollFactor,WarmupCount,Strategy,Mean,Error,StdDev,Scaled,ScaledSD,Gen 0,Allocated
MultiKeyMap_TryGetFullKeysByPartialKey,Default,False,Default,Default,Default,Default,Default,Default,255,RyuJit,X64,Core,False,True,False,True,False,False,Default,Default,Default,1,Default,Default,Default,Default,16,Default,OptimizedForNonPositionalSearch,"5,176.8 ns",35.2651 ns,32.9870 ns,39.87,0.26,0.2594,1112 B
MultiKeyMap_Mixed_Positional_TryGetFullKeysByPartialKey,Default,False,Default,Default,Default,Default,Default,Default,255,RyuJit,X64,Core,False,True,False,True,False,False,Default,Default,Default,1,Default,Default,Default,Default,16,Default,OptimizedForNonPositionalSearch,"8,644.0 ns",41.3801 ns,38.7070 ns,66.57,0.33,0.4883,2056 B
MultiKeyMap_Only_Positional_TryGetFullKeysByPartialKey,Default,False,Default,Default,Default,Default,Default,Default,255,RyuJit,X64,Core,False,True,False,True,False,False,Default,Default,Default,1,Default,Default,Default,Default,16,Default,OptimizedForNonPositionalSearch,"10,103.6 ns",21.8971 ns,20.4825 ns,77.81,0.23,0.6409,2720 B
Dictionary_TryGetValue,Default,False,Default,Default,Default,Default,Default,Default,255,RyuJit,X64,Core,False,True,False,True,False,False,Default,Default,Default,1,Default,Default,Default,Default,16,Default,OptimizedForNonPositionalSearch,129.8 ns,0.3481 ns,0.3086 ns,1.00,0.00,0.0303,128 B
MultiKeyMap_TryGetFullKeysByPartialKey,Default,False,Default,Default,Default,Default,Default,Default,255,RyuJit,X64,Core,False,True,False,True,False,False,Default,Default,Default,1,Default,Default,Default,Default,16,Default,OptimizedForPositionalSearch,"14,046.4 ns",45.8984 ns,40.6877 ns,107.24,0.41,1.8921,8024 B
MultiKeyMap_Mixed_Positional_TryGetFullKeysByPartialKey,Default,False,Default,Default,Default,Default,Default,Default,255,RyuJit,X64,Core,False,True,False,True,False,False,Default,Default,Default,1,Default,Default,Default,Default,16,Default,OptimizedForPositionalSearch,"12,917.5 ns",28.6502 ns,23.9242 ns,98.62,0.31,1.2054,5104 B
MultiKeyMap_Only_Positional_TryGetFullKeysByPartialKey,Default,False,Default,Default,Default,Default,Default,Default,255,RyuJit,X64,Core,False,True,False,True,False,False,Default,Default,Default,1,Default,Default,Default,Default,16,Default,OptimizedForPositionalSearch,"3,074.5 ns",6.0024 ns,5.0123 ns,23.47,0.07,0.2975,1256 B
Dictionary_TryGetValue,Default,False,Default,Default,Default,Default,Default,Default,255,RyuJit,X64,Core,False,True,False,True,False,False,Default,Default,Default,1,Default,Default,Default,Default,16,Default,OptimizedForPositionalSearch,131.0 ns,0.3932 ns,0.3485 ns,1.00,0.00,0.0303,128 B
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='utf-8' />
<title>MultiKeyMapVsDictionaryTryGetsByPartialKeyStrings1000rows1search</title>

<style type="text/css">
table { border-collapse: collapse; display: block; width: 100%; overflow: auto; }
td, th { padding: 6px 13px; border: 1px solid #ddd; }
tr { background-color: #fff; border-top: 1px solid #ccc; }
tr:nth-child(even) { background: #f8f8f8; }
</style>
</head>
<body>
<pre><code>
BenchmarkDotNet=v0.10.6, OS=Windows 10 Redstone 2 (10.0.15063)
Processor=Intel Core i7-4790 CPU 3.60GHz (Haswell), ProcessorCount=8
Frequency=3507520 Hz, Resolution=285.1017 ns, Timer=TSC
dotnet cli version=1.0.4
[Host] : .NET Core 4.6.25211.01, 64bit RyuJIT
DefaultJob : .NET Core 4.6.25211.01, 64bit RyuJIT
</code></pre>
<pre><code></code></pre>

<table>
<thead><tr><th> Method</th><th> Strategy</th><th> Mean</th><th>Error</th><th>StdDev</th><th>Scaled</th><th>ScaledSD</th><th>Gen 0</th><th>Allocated</th>
</tr>
</thead><tbody><tr><td> MultiKeyMap_TryGetFullKeysByPartialKey</td><td>OptimizedForNonPositionalSearch</td><td>5,176.8 ns</td><td>35.2651 ns</td><td>32.9870 ns</td><td>39.87</td><td>0.26</td><td>0.2594</td><td>1112 B</td>
</tr><tr><td>MultiKeyMap_Mixed_Positional_TryGetFullKeysByPartialKey</td><td>OptimizedForNonPositionalSearch</td><td>8,644.0 ns</td><td>41.3801 ns</td><td>38.7070 ns</td><td>66.57</td><td>0.33</td><td>0.4883</td><td>2056 B</td>
</tr><tr><td>MultiKeyMap_Only_Positional_TryGetFullKeysByPartialKey</td><td>OptimizedForNonPositionalSearch</td><td>10,103.6 ns</td><td>21.8971 ns</td><td>20.4825 ns</td><td>77.81</td><td>0.23</td><td>0.6409</td><td>2720 B</td>
</tr><tr><td> Dictionary_TryGetValue</td><td>OptimizedForNonPositionalSearch</td><td>129.8 ns</td><td>0.3481 ns</td><td>0.3086 ns</td><td>1.00</td><td>0.00</td><td>0.0303</td><td>128 B</td>
</tr><tr><td> MultiKeyMap_TryGetFullKeysByPartialKey</td><td>OptimizedForPositionalSearch</td><td>14,046.4 ns</td><td>45.8984 ns</td><td>40.6877 ns</td><td>107.24</td><td>0.41</td><td>1.8921</td><td>8024 B</td>
</tr><tr><td>MultiKeyMap_Mixed_Positional_TryGetFullKeysByPartialKey</td><td>OptimizedForPositionalSearch</td><td>12,917.5 ns</td><td>28.6502 ns</td><td>23.9242 ns</td><td>98.62</td><td>0.31</td><td>1.2054</td><td>5104 B</td>
</tr><tr><td>MultiKeyMap_Only_Positional_TryGetFullKeysByPartialKey</td><td>OptimizedForPositionalSearch</td><td>3,074.5 ns</td><td>6.0024 ns</td><td>5.0123 ns</td><td>23.47</td><td>0.07</td><td>0.2975</td><td>1256 B</td>
</tr><tr><td> Dictionary_TryGetValue</td><td>OptimizedForPositionalSearch</td><td>131.0 ns</td><td>0.3932 ns</td><td>0.3485 ns</td><td>1.00</td><td>0.00</td><td>0.0303</td><td>128 B</td>
</tr></tbody></table>
</body>
</html>
Loading

0 comments on commit 2c841da

Please sign in to comment.