Skip to content

Commit

Permalink
Update Benchmark Results
Browse files Browse the repository at this point in the history
  • Loading branch information
iwillspeak committed Jun 9, 2021
1 parent a63767e commit 87ab1c7
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 31 deletions.
4 changes: 4 additions & 0 deletions bench/Alice/Alice.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
<PackageReference Condition="$(IncludeRe2)" Include="IronRe2" Version="1.0.1" />
</ItemGroup>

<PropertyGroup Condition="$(IncludeRe2)">
<DefineConstants>IncludeRe2</DefineConstants>
</PropertyGroup>

<ItemGroup>
<Content Include="Alice's_Adventures_in_Wonderland.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand Down
69 changes: 38 additions & 31 deletions bench/Alice/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Alice's Adventures in Wonderland

This folder contains a simple test executable which benchmark the performance of .NET regex against IronRure.

``` ini

BenchmarkDotNet=v0.13.0, OS=fedora 34
Expand All @@ -11,34 +12,40 @@ Intel Core i7-10750H CPU 2.60GHz, 1 CPU, 12 logical and 6 physical cores


```
| Method | Pattern | Mean | Error | StdDev | Ratio | RatioSD | Rank | Gen 0 | Gen 1 | Gen 2 | Allocated |
|--------------------- |--------------------- |------------:|------------:|----------:|------:|--------:|-----:|--------:|--------:|--------:|----------:|
| **DotnetRegex** | **([A-Z(...)zA-Z] [39]** | **1,637.3 μs** | **4.24 μs** | **3.76 μs** | **1.00** | **0.00** | **2** | **17.5781** | **3.9063** | **-** | **111,889 B** |
| DotnetRegexNoCompile | ([A-Z(...)zA-Z] [39] | 17,073.1 μs | 35.93 μs | 31.85 μs | 10.43 | 0.04 | 3 | - | - | - | 111,897 B |
| RustRegex | ([A-Z(...)zA-Z] [39] | 446.1 μs | 2.85 μs | 2.53 μs | 0.27 | 0.00 | 1 | 52.2461 | 52.2461 | 52.2461 | 190,263 B |
| RustRegexUnicode | ([A-Z(...)zA-Z] [39] | 443.4 μs | 2.24 μs | 1.87 μs | 0.27 | 0.00 | 1 | 52.2461 | 52.2461 | 52.2461 | 190,263 B |
| | | | | | | | | | | | |
| **DotnetRegex** | **.{0,3(...)inah) [35]** | **31,646.7 μs** | **591.55 μs** | **553.33 μs** | **1.00** | **0.00** | **2** | **-** | **-** | **-** | **129,762 B** |
| DotnetRegexNoCompile | .{0,3(...)inah) [35] | 96,050.8 μs | 1,029.18 μs | 962.69 μs | 3.04 | 0.06 | 3 | - | - | - | 131,311 B |
| RustRegex | .{0,3(...)inah) [35] | 458.5 μs | 7.92 μs | 7.40 μs | 0.01 | 0.00 | 1 | 52.2461 | 52.2461 | 52.2461 | 193,143 B |
| RustRegexUnicode | .{0,3(...)inah) [35] | 455.6 μs | 5.36 μs | 4.18 μs | 0.01 | 0.00 | 1 | 52.2461 | 52.2461 | 52.2461 | 193,144 B |
| | | | | | | | | | | | |
| **DotnetRegex** | **Alice(...)Alice [37]** | **943.7 μs** | **10.87 μs** | **10.17 μs** | **1.00** | **0.00** | **2** | **-** | **-** | **-** | **592 B** |
| DotnetRegexNoCompile | Alice(...)Alice [37] | 2,422.3 μs | 38.08 μs | 40.75 μs | 2.57 | 0.06 | 3 | - | - | - | 593 B |
| RustRegex | Alice(...)Alice [37] | 211.0 μs | 0.51 μs | 0.48 μs | 0.22 | 0.00 | 1 | 52.4902 | 52.4902 | 52.4902 | 173,663 B |
| RustRegexUnicode | Alice(...)Alice [37] | 214.2 μs | 3.42 μs | 3.20 μs | 0.23 | 0.00 | 1 | 52.4902 | 52.4902 | 52.4902 | 173,663 B |
| | | | | | | | | | | | |
| **DotnetRegex** | **Alice|Adventure** | **1,077.6 μs** | **5.97 μs** | **5.29 μs** | **1.00** | **0.00** | **3** | **13.6719** | **1.9531** | **-** | **96,457 B** |
| DotnetRegexNoCompile | Alice|Adventure | 1,593.6 μs | 1.31 μs | 1.23 μs | 1.48 | 0.01 | 4 | 13.6719 | 1.9531 | - | 96,457 B |
| RustRegex | Alice|Adventure | 191.8 μs | 2.99 μs | 2.50 μs | 0.18 | 0.00 | 1 | 52.4902 | 52.4902 | 52.4902 | 190,503 B |
| RustRegexUnicode | Alice|Adventure | 200.3 μs | 3.98 μs | 6.07 μs | 0.19 | 0.01 | 2 | 52.4902 | 52.4902 | 52.4902 | 190,503 B |
| | | | | | | | | | | | |
| **DotnetRegex** | **[a-zA-Z]+ing** | **5,964.2 μs** | **21.74 μs** | **19.27 μs** | **1.00** | **0.00** | **2** | **39.0625** | **7.8125** | **-** | **257,946 B** |
| DotnetRegexNoCompile | [a-zA-Z]+ing | 12,941.9 μs | 27.27 μs | 21.29 μs | 2.17 | 0.01 | 3 | 31.2500 | - | - | 257,948 B |
| RustRegex | [a-zA-Z]+ing | 551.5 μs | 9.46 μs | 8.39 μs | 0.09 | 0.00 | 1 | 51.7578 | 51.7578 | 51.7578 | 216,823 B |
| RustRegexUnicode | [a-zA-Z]+ing | 561.2 μs | 11.10 μs | 27.23 μs | 0.10 | 0.00 | 1 | 51.7578 | 51.7578 | 51.7578 | 216,823 B |
| | | | | | | | | | | | |
| **DotnetRegex** | **\b(\w+)-legged** | **6,583.4 μs** | **22.06 μs** | **18.42 μs** | **1.00** | **0.00** | **2** | **-** | **-** | **-** | **674 B** |
| DotnetRegexNoCompile | \b(\w+)-legged | 11,022.4 μs | 217.83 μs | 435.04 μs | 1.63 | 0.12 | 3 | - | - | - | 676 B |
| RustRegex | \b(\w+)-legged | 390.4 μs | 1.33 μs | 1.24 μs | 0.06 | 0.00 | 1 | 52.2461 | 52.2461 | 52.2461 | 173,663 B |
| RustRegexUnicode | \b(\w+)-legged | 6,656.9 μs | 30.93 μs | 27.42 μs | 1.01 | 0.00 | 2 | 46.8750 | 46.8750 | 46.8750 | 173,664 B |
| Method | Pattern | Mean | Error | StdDev | Ratio | RatioSD | Rank | Gen 0 | Gen 1 | Gen 2 | Allocated |
|--------------------- |--------------------- |------------:|----------:|----------:|------:|--------:|-----:|--------:|--------:|--------:|----------:|
| **DotnetRegex** | **([A-Z(...)zA-Z] [39]** | **1,568.7 μs** | **3.91 μs** | **3.66 μs** | **1.00** | **0.00** | **3** | **17.5781** | **3.9063** | **-** | **111,889 B** |
| DotnetRegexNoCompile | ([A-Z(...)zA-Z] [39] | 16,727.1 μs | 41.55 μs | 38.87 μs | 10.66 | 0.03 | 4 | - | - | - | 111,897 B |
| Re2Regex | ([A-Z(...)zA-Z] [39] | 933.8 μs | 2.67 μs | 2.36 μs | 0.60 | 0.00 | 2 | 51.7578 | 51.7578 | 51.7578 | 230,255 B |
| RustRegex | ([A-Z(...)zA-Z] [39] | 432.5 μs | 1.25 μs | 1.17 μs | 0.28 | 0.00 | 1 | 52.2461 | 52.2461 | 52.2461 | 190,263 B |
| RustRegexUnicode | ([A-Z(...)zA-Z] [39] | 436.7 μs | 2.72 μs | 2.41 μs | 0.28 | 0.00 | 1 | 52.2461 | 52.2461 | 52.2461 | 190,263 B |
| | | | | | | | | | | | |
| **DotnetRegex** | **.{0,3(...)inah) [35]** | **30,187.8 μs** | **121.08 μs** | **101.11 μs** | **1.00** | **0.00** | **4** | **-** | **-** | **-** | **129,753 B** |
| DotnetRegexNoCompile | .{0,3(...)inah) [35] | 87,722.7 μs | 548.55 μs | 428.27 μs | 2.91 | 0.02 | 5 | - | - | - | 129,901 B |
| Re2Regex | .{0,3(...)inah) [35] | 625.6 μs | 6.18 μs | 5.78 μs | 0.02 | 0.00 | 3 | 51.7578 | 51.7578 | 51.7578 | 240,047 B |
| RustRegex | .{0,3(...)inah) [35] | 453.5 μs | 1.89 μs | 1.67 μs | 0.02 | 0.00 | 2 | 52.2461 | 52.2461 | 52.2461 | 193,143 B |
| RustRegexUnicode | .{0,3(...)inah) [35] | 446.7 μs | 1.69 μs | 1.41 μs | 0.01 | 0.00 | 1 | 52.2461 | 52.2461 | 52.2461 | 193,143 B |
| | | | | | | | | | | | |
| **DotnetRegex** | **Alice(...)Alice [37]** | **925.9 μs** | **3.17 μs** | **2.96 μs** | **1.00** | **0.00** | **3** | **-** | **-** | **-** | **592 B** |
| DotnetRegexNoCompile | Alice(...)Alice [37] | 2,759.1 μs | 12.86 μs | 11.40 μs | 2.98 | 0.02 | 4 | - | - | - | 593 B |
| Re2Regex | Alice(...)Alice [37] | 569.4 μs | 3.58 μs | 2.99 μs | 0.62 | 0.00 | 2 | 51.7578 | 51.7578 | 51.7578 | 173,815 B |
| RustRegex | Alice(...)Alice [37] | 210.7 μs | 0.62 μs | 0.55 μs | 0.23 | 0.00 | 1 | 52.4902 | 52.4902 | 52.4902 | 173,663 B |
| RustRegexUnicode | Alice(...)Alice [37] | 212.0 μs | 0.31 μs | 0.27 μs | 0.23 | 0.00 | 1 | 52.4902 | 52.4902 | 52.4902 | 173,663 B |
| | | | | | | | | | | | |
| **DotnetRegex** | **Alice|Adventure** | **1,037.7 μs** | **5.76 μs** | **5.39 μs** | **1.00** | **0.00** | **3** | **13.6719** | **1.9531** | **-** | **96,457 B** |
| DotnetRegexNoCompile | Alice|Adventure | 1,555.6 μs | 20.23 μs | 18.92 μs | 1.50 | 0.02 | 4 | 13.6719 | 1.9531 | - | 96,457 B |
| Re2Regex | Alice|Adventure | 634.2 μs | 5.89 μs | 5.51 μs | 0.61 | 0.01 | 2 | 51.7578 | 51.7578 | 51.7578 | 231,071 B |
| RustRegex | Alice|Adventure | 188.6 μs | 0.53 μs | 0.47 μs | 0.18 | 0.00 | 1 | 52.4902 | 52.4902 | 52.4902 | 190,503 B |
| RustRegexUnicode | Alice|Adventure | 192.4 μs | 3.71 μs | 3.10 μs | 0.19 | 0.00 | 1 | 52.4902 | 52.4902 | 52.4902 | 190,503 B |
| | | | | | | | | | | | |
| **DotnetRegex** | **[a-zA-Z]+ing** | **5,811.0 μs** | **72.59 μs** | **67.90 μs** | **1.00** | **0.00** | **3** | **39.0625** | **7.8125** | **-** | **257,946 B** |
| DotnetRegexNoCompile | [a-zA-Z]+ing | 12,668.6 μs | 55.85 μs | 46.64 μs | 2.17 | 0.02 | 4 | 31.2500 | - | - | 257,948 B |
| Re2Regex | [a-zA-Z]+ing | 1,169.1 μs | 3.94 μs | 3.49 μs | 0.20 | 0.00 | 2 | 50.7813 | 50.7813 | 50.7813 | 320,559 B |
| RustRegex | [a-zA-Z]+ing | 536.6 μs | 5.02 μs | 4.69 μs | 0.09 | 0.00 | 1 | 51.7578 | 51.7578 | 51.7578 | 216,824 B |
| RustRegexUnicode | [a-zA-Z]+ing | 528.5 μs | 2.30 μs | 1.92 μs | 0.09 | 0.00 | 1 | 51.7578 | 51.7578 | 51.7578 | 216,823 B |
| | | | | | | | | | | | |
| **DotnetRegex** | **\b(\w+)-legged** | **5,498.0 μs** | **30.20 μs** | **25.22 μs** | **1.00** | **0.00** | **3** | **-** | **-** | **-** | **675 B** |
| DotnetRegexNoCompile | \b(\w+)-legged | 9,454.6 μs | 20.00 μs | 15.61 μs | 1.72 | 0.01 | 5 | - | - | - | 676 B |
| Re2Regex | \b(\w+)-legged | 404.6 μs | 0.91 μs | 0.85 μs | 0.07 | 0.00 | 2 | 52.2461 | 52.2461 | 52.2461 | 173,815 B |
| RustRegex | \b(\w+)-legged | 379.3 μs | 0.44 μs | 0.39 μs | 0.07 | 0.00 | 1 | 52.2461 | 52.2461 | 52.2461 | 173,663 B |
| RustRegexUnicode | \b(\w+)-legged | 6,493.3 μs | 80.03 μs | 74.86 μs | 1.18 | 0.01 | 4 | 46.8750 | 46.8750 | 46.8750 | 173,664 B |

0 comments on commit 87ab1c7

Please sign in to comment.