Skip to content

Benchmarks

Darrell edited this page Dec 11, 2016 · 6 revisions

The following are the results from the latest benchmarks, that compared DotNetGlob against https://github.com/kthompson/glob/

The reason for the benchmarks was to see how DotNet Glob stacks up against an alternative implementation that is Regex based.

The following are the results from benchmarking the Glob.IsMatch() method, against a number of generated non-matching strings. A number of diffrent globbing patterns are tested.

BenchmarkDotNet=v0.10.1, OS=Windows
Processor=?, ProcessorCount=8
Frequency=2992662 Hz, Resolution=334.1507 ns, Timer=TSC
dotnet cli version=1.0.0-preview2-003131
  [Host] : .NET Core 4.6.24628.01, 64bit RyuJIT
  Clr    : Clr 4.0.30319.42000, 64bit RyuJIT-v4.6.1586.0
  Core   : .NET Core 4.6.24628.01, 64bit RyuJIT

        Method |  Job | Runtime | NumberOfMatches |                                    GlobPattern |              Mean |        StdErr |         StdDev |               Min |               Max | Scaled | Scaled-StdDev |  Gen 0 | Allocated |

------------------ |----- |-------- |---------------- |----------------------------------------------- |------------------ |-------------- |--------------- |------------------ |------------------ |------- |-------------- |------- |---------- | GlobIsMatch | Clr | Clr | 1 | p?th/a[bcd]b[e-g].txt | 438.7774 ns | 1.4121 ns | 4.6835 ns | 433.3894 ns | 446.5811 ns | 1.00 | 0.00 | 0.0103 | 72 B | DotNetGlobIsMatch | Clr | Clr | 1 | p?th/a[bcd]b[e-g].txt | 52.1962 ns | 0.5540 ns | 2.6570 ns | 48.9288 ns | 57.0133 ns | 0.12 | 0.01 | 0.0136 | 72 B | GlobIsMatch | Core | Core | 1 | p?th/a[bcd]b[e-g].txt | 396.2710 ns | 2.4433 ns | 9.4629 ns | 375.8448 ns | 406.8400 ns | 1.00 | 0.00 | 0.0121 | 71 B | DotNetGlobIsMatch | Core | Core | 1 | p?th/a[bcd]b[e-g].txt | 34.5538 ns | 0.1344 ns | 0.5030 ns | 33.7141 ns | 35.1947 ns | 0.09 | 0.00 | 0.0154 | 71 B | GlobIsMatch | Clr | Clr | 1 | p?th/a[bcd]b[e-g]a[1-4][!wxyz][!a-c][!1-3].txt | 445.7739 ns | 4.4130 ns | 24.5704 ns | 416.1550 ns | 509.8634 ns | 1.00 | 0.00 | 0.0063 | 72 B | DotNetGlobIsMatch | Clr | Clr | 1 | p?th/a[bcd]b[e-g]a[1-4][!wxyz][!a-c][!1-3].txt | 36.3235 ns | 0.2136 ns | 0.7701 ns | 35.3784 ns | 38.4200 ns | 0.08 | 0.00 | 0.0157 | 72 B | GlobIsMatch | Core | Core | 1 | p?th/a[bcd]b[e-g]a[1-4][!wxyz][!a-c][!1-3].txt | 177.5349 ns | 1.2938 ns | 5.0109 ns | 168.5177 ns | 185.8773 ns | 1.00 | 0.00 | 0.0107 | 71 B | DotNetGlobIsMatch | Core | Core | 1 | p?th/a[bcd]b[e-g]a[1-4][!wxyz][!a-c][!1-3].txt | 33.4483 ns | 0.2574 ns | 0.9631 ns | 32.0475 ns | 35.0871 ns | 0.19 | 0.01 | 0.0156 | 71 B | GlobIsMatch | Clr | Clr | 1 | p?th/a[e-g].txt | 429.7520 ns | 3.2883 ns | 12.7356 ns | 411.9470 ns | 457.9446 ns | 1.00 | 0.00 | 0.0140 | 72 B | DotNetGlobIsMatch | Clr | Clr | 1 | p?th/a[e-g].txt | 51.0252 ns | 0.0888 ns | 0.2946 ns | 50.4249 ns | 51.4471 ns | 0.12 | 0.00 | 0.0139 | 72 B | GlobIsMatch | Core | Core | 1 | p?th/a[e-g].txt | 132.5256 ns | 0.1426 ns | 0.5524 ns | 131.2557 ns | 133.4873 ns | 1.00 | 0.00 | 0.0103 | 71 B | DotNetGlobIsMatch | Core | Core | 1 | p?th/a[e-g].txt | 47.3372 ns | 0.0414 ns | 0.1603 ns | 47.0937 ns | 47.6537 ns | 0.36 | 0.00 | 0.0155 | 71 B | GlobIsMatch | Clr | Clr | 10 | p?th/a[bcd]b[e-g].txt | 1,886.0987 ns | 8.6291 ns | 33.4203 ns | 1,860.4956 ns | 1,958.0471 ns | 1.00 | 0.00 | - | 80 B | DotNetGlobIsMatch | Clr | Clr | 10 | p?th/a[bcd]b[e-g].txt | 254.3935 ns | 1.0359 ns | 3.8759 ns | 251.4588 ns | 263.4622 ns | 0.13 | 0.00 | 0.0064 | 80 B | GlobIsMatch | Core | Core | 10 | p?th/a[bcd]b[e-g].txt | 1,627.5701 ns | 4.4247 ns | 15.9536 ns | 1,592.4312 ns | 1,658.0723 ns | 1.00 | 0.00 | - | 79 B | DotNetGlobIsMatch | Core | Core | 10 | p?th/a[bcd]b[e-g].txt | 284.3986 ns | 0.5170 ns | 1.8639 ns | 281.9634 ns | 288.4155 ns | 0.17 | 0.00 | 0.0062 | 79 B | GlobIsMatch | Clr | Clr | 10 | p?th/a[bcd]b[e-g]a[1-4][!wxyz][!a-c][!1-3].txt | 1,834.1529 ns | 2.8616 ns | 9.4909 ns | 1,816.6913 ns | 1,846.9472 ns | 1.00 | 0.00 | - | 80 B | DotNetGlobIsMatch | Clr | Clr | 10 | p?th/a[bcd]b[e-g]a[1-4][!wxyz][!a-c][!1-3].txt | 334.3087 ns | 2.1560 ns | 8.0670 ns | 327.5516 ns | 352.1619 ns | 0.18 | 0.00 | 0.0062 | 80 B | GlobIsMatch | Core | Core | 10 | p?th/a[bcd]b[e-g]a[1-4][!wxyz][!a-c][!1-3].txt | 2,656.8211 ns | 3.5422 ns | 13.7190 ns | 2,628.1660 ns | 2,678.0010 ns | 1.00 | 0.00 | - | 79 B | DotNetGlobIsMatch | Core | Core | 10 | p?th/a[bcd]b[e-g]a[1-4][!wxyz][!a-c][!1-3].txt | 278.4699 ns | 0.4433 ns | 1.5982 ns | 277.1562 ns | 281.6823 ns | 0.10 | 0.00 | 0.0067 | 79 B | GlobIsMatch | Clr | Clr | 10 | p?th/a[e-g].txt | 1,149.4689 ns | 2.3841 ns | 8.2586 ns | 1,129.0308 ns | 1,158.3230 ns | 1.00 | 0.00 | - | 80 B | DotNetGlobIsMatch | Clr | Clr | 10 | p?th/a[e-g].txt | 331.1755 ns | 2.2205 ns | 8.5999 ns | 321.5945 ns | 346.4665 ns | 0.29 | 0.01 | 0.0064 | 80 B | GlobIsMatch | Core | Core | 10 | p?th/a[e-g].txt | 1,850.0311 ns | 1.9145 ns | 6.9026 ns | 1,841.7888 ns | 1,866.2959 ns | 1.00 | 0.00 | - | 79 B | DotNetGlobIsMatch | Core | Core | 10 | p?th/a[e-g].txt | 277.9618 ns | 0.2033 ns | 0.7044 ns | 276.7124 ns | 279.0890 ns | 0.15 | 0.00 | 0.0059 | 79 B | GlobIsMatch | Clr | Clr | 100 | p?th/a[bcd]b[e-g].txt | 16,746.9010 ns | 122.0821 ns | 472.8219 ns | 16,405.8051 ns | 17,857.2313 ns | 1.00 | 0.00 | - | 168 B | DotNetGlobIsMatch | Clr | Clr | 100 | p?th/a[bcd]b[e-g].txt | 3,016.0446 ns | 15.5568 ns | 58.2082 ns | 2,895.4311 ns | 3,108.5735 ns | 0.18 | 0.01 | - | 168 B | GlobIsMatch | Core | Core | 100 | p?th/a[bcd]b[e-g].txt | 19,075.4075 ns | 12.8506 ns | 48.0825 ns | 18,980.4472 ns | 19,151.9074 ns | 1.00 | 0.00 | - | 168 B | DotNetGlobIsMatch | Core | Core | 100 | p?th/a[bcd]b[e-g].txt | 2,827.5150 ns | 4.8301 ns | 18.0726 ns | 2,793.6716 ns | 2,845.5283 ns | 0.15 | 0.00 | - | 167 B | GlobIsMatch | Clr | Clr | 100 | p?th/a[bcd]b[e-g]a[1-4][!wxyz][!a-c][!1-3].txt | 18,902.7776 ns | 85.3755 ns | 319.4458 ns | 18,583.4162 ns | 19,518.9524 ns | 1.00 | 0.00 | - | 168 B | DotNetGlobIsMatch | Clr | Clr | 100 | p?th/a[bcd]b[e-g]a[1-4][!wxyz][!a-c][!1-3].txt | 3,012.3373 ns | 5.3890 ns | 19.4304 ns | 2,986.8841 ns | 3,061.4276 ns | 0.16 | 0.00 | - | 168 B | GlobIsMatch | Core | Core | 100 | p?th/a[bcd]b[e-g]a[1-4][!wxyz][!a-c][!1-3].txt | 20,805.3346 ns | 19.0601 ns | 73.8195 ns | 20,676.3311 ns | 20,924.3948 ns | 1.00 | 0.00 | - | 168 B | DotNetGlobIsMatch | Core | Core | 100 | p?th/a[bcd]b[e-g]a[1-4][!wxyz][!a-c][!1-3].txt | 3,008.1070 ns | 23.5896 ns | 91.3620 ns | 2,897.3421 ns | 3,187.6131 ns | 0.14 | 0.00 | - | 167 B | GlobIsMatch | Clr | Clr | 100 | p?th/a[e-g].txt | 15,922.1320 ns | 8.2271 ns | 28.4997 ns | 15,868.7806 ns | 15,975.8540 ns | 1.00 | 0.00 | - | 168 B | DotNetGlobIsMatch | Clr | Clr | 100 | p?th/a[e-g].txt | 2,955.2057 ns | 1.2318 ns | 4.0856 ns | 2,949.5904 ns | 2,962.8853 ns | 0.19 | 0.00 | - | 168 B | GlobIsMatch | Core | Core | 100 | p?th/a[e-g].txt | 15,866.1932 ns | 40.9957 ns | 153.3919 ns | 15,644.8047 ns | 16,257.7134 ns | 1.00 | 0.00 | - | 168 B | DotNetGlobIsMatch | Core | Core | 100 | p?th/a[e-g].txt | 2,808.9175 ns | 1.5857 ns | 5.4929 ns | 2,797.0750 ns | 2,818.6885 ns | 0.18 | 0.00 | - | 167 B | GlobIsMatch | Clr | Clr | 500 | p?th/a[bcd]b[e-g].txt | 90,808.4986 ns | 97.6309 ns | 338.2033 ns | 90,130.4417 ns | 91,379.5909 ns | 1.00 | 0.00 | - | 570 B | DotNetGlobIsMatch | Clr | Clr | 500 | p?th/a[bcd]b[e-g].txt | 15,111.3853 ns | 54.2828 ns | 203.1077 ns | 14,811.9570 ns | 15,577.8685 ns | 0.17 | 0.00 | - | 568 B | GlobIsMatch | Core | Core | 500 | p?th/a[bcd]b[e-g].txt | 91,526.7553 ns | 27.2052 ns | 94.2415 ns | 91,341.7324 ns | 91,680.9410 ns | 1.00 | 0.00 | - | 568 B | DotNetGlobIsMatch | Core | Core | 500 | p?th/a[bcd]b[e-g].txt | 14,541.6381 ns | 8.9120 ns | 32.1325 ns | 14,501.2891 ns | 14,619.3146 ns | 0.16 | 0.00 | - | 566 B | GlobIsMatch | Clr | Clr | 500 | p?th/a[bcd]b[e-g]a[1-4][!wxyz][!a-c][!1-3].txt | 110,136.4226 ns | 340.7083 ns | 1,228.4412 ns | 109,157.1895 ns | 113,450.5687 ns | 1.00 | 0.00 | - | 572 B | DotNetGlobIsMatch | Clr | Clr | 500 | p?th/a[bcd]b[e-g]a[1-4][!wxyz][!a-c][!1-3].txt | 15,135.7505 ns | 93.7199 ns | 350.6677 ns | 14,752.7437 ns | 15,964.5294 ns | 0.14 | 0.00 | - | 568 B | GlobIsMatch | Core | Core | 500 | p?th/a[bcd]b[e-g]a[1-4][!wxyz][!a-c][!1-3].txt | 110,143.4762 ns | 59.4182 ns | 222.3227 ns | 109,936.7765 ns | 110,739.5212 ns | 1.00 | 0.00 | - | 570 B | DotNetGlobIsMatch | Core | Core | 500 | p?th/a[bcd]b[e-g]a[1-4][!wxyz][!a-c][!1-3].txt | 14,996.4478 ns | 7.6094 ns | 27.4362 ns | 14,967.2563 ns | 15,056.4434 ns | 0.14 | 0.00 | - | 566 B | GlobIsMatch | Clr | Clr | 500 | p?th/a[e-g].txt | 83,982.5997 ns | 143.8127 ns | 538.0980 ns | 83,307.2417 ns | 85,011.7691 ns | 1.00 | 0.00 | - | 570 B | DotNetGlobIsMatch | Clr | Clr | 500 | p?th/a[e-g].txt | 14,921.9646 ns | 129.0558 ns | 499.8309 ns | 14,354.6441 ns | 15,728.9774 ns | 0.18 | 0.01 | - | 568 B | GlobIsMatch | Core | Core | 500 | p?th/a[e-g].txt | 79,611.3701 ns | 53.2812 ns | 199.3601 ns | 79,330.3920 ns | 79,949.0928 ns | 1.00 | 0.00 | - | 568 B | DotNetGlobIsMatch | Core | Core | 500 | p?th/a[e-g].txt | 14,721.3069 ns | 8.3906 ns | 31.3948 ns | 14,675.9092 ns | 14,800.6854 ns | 0.18 | 0.00 | - | 566 B | GlobIsMatch | Clr | Clr | 1000 | p?th/a[bcd]b[e-g].txt | 179,312.4372 ns | 255.7982 ns | 886.1111 ns | 177,385.3603 ns | 181,122.6919 ns | 1.00 | 0.00 | - | 1.07 kB | DotNetGlobIsMatch | Clr | Clr | 1000 | p?th/a[bcd]b[e-g].txt | 29,875.3590 ns | 104.8125 ns | 392.1726 ns | 29,130.7427 ns | 30,382.7064 ns | 0.17 | 0.00 | - | 1.07 kB | GlobIsMatch | Core | Core | 1000 | p?th/a[bcd]b[e-g].txt | 182,333.7624 ns | 74.2675 ns | 257.2701 ns | 182,127.1344 ns | 183,051.5962 ns | 1.00 | 0.00 | - | 1.07 kB | DotNetGlobIsMatch | Core | Core | 1000 | p?th/a[bcd]b[e-g].txt | 29,565.3269 ns | 17.9125 ns | 62.0506 ns | 29,489.7943 ns | 29,706.8372 ns | 0.16 | 0.00 | - | 1.06 kB | GlobIsMatch | Clr | Clr | 1000 | p?th/a[bcd]b[e-g]a[1-4][!wxyz][!a-c][!1-3].txt | 207,200.3450 ns | 1,630.1409 ns | 6,313.5084 ns | 201,556.1792 ns | 220,879.1593 ns | 1.00 | 0.00 | - | 1.07 kB | DotNetGlobIsMatch | Clr | Clr | 1000 | p?th/a[bcd]b[e-g]a[1-4][!wxyz][!a-c][!1-3].txt | 29,720.1021 ns | 206.0235 ns | 797.9254 ns | 29,147.2925 ns | 31,736.2260 ns | 0.14 | 0.01 | - | 1.07 kB | GlobIsMatch | Core | Core | 1000 | p?th/a[bcd]b[e-g]a[1-4][!wxyz][!a-c][!1-3].txt | 220,967.4830 ns | 853.4475 ns | 3,305.3879 ns | 214,233.6292 ns | 224,724.7853 ns | 1.00 | 0.00 | - | 1.07 kB | DotNetGlobIsMatch | Core | Core | 1000 | p?th/a[bcd]b[e-g]a[1-4][!wxyz][!a-c][!1-3].txt | 29,608.2140 ns | 25.1971 ns | 90.8494 ns | 29,418.6540 ns | 29,808.2381 ns | 0.13 | 0.00 | - | 1.06 kB | GlobIsMatch | Clr | Clr | 1000 | p?th/a[e-g].txt | 150,769.9661 ns | 1,348.4433 ns | 5,222.4986 ns | 146,728.6792 ns | 165,185.6087 ns | 1.00 | 0.00 | - | 1.07 kB | DotNetGlobIsMatch | Clr | Clr | 1000 | p?th/a[e-g].txt | 30,180.6390 ns | 93.3516 ns | 349.2897 ns | 29,933.2455 ns | 31,079.4818 ns | 0.20 | 0.01 | - | 1.07 kB | GlobIsMatch | Core | Core | 1000 | p?th/a[e-g].txt | 167,399.5200 ns | 123.6694 ns | 445.8962 ns | 166,651.2705 ns | 168,019.3629 ns | 1.00 | 0.00 | - | 1.07 kB | DotNetGlobIsMatch | Core | Core | 1000 | p?th/a[e-g].txt | 28,978.0363 ns | 24.3812 ns | 87.9075 ns | 28,783.1831 ns | 29,120.1482 ns | 0.17 | 0.00 | - | 1.06 kB | GlobIsMatch | Clr | Clr | 10000 | p?th/a[bcd]b[e-g].txt | 1,815,052.0926 ns | 7,045.3811 ns | 26,361.4023 ns | 1,782,684.2303 ns | 1,875,797.4018 ns | 1.00 | 0.00 | - | 10.11 kB | DotNetGlobIsMatch | Clr | Clr | 10000 | p?th/a[bcd]b[e-g].txt | 299,010.2274 ns | 175.9343 ns | 527.8030 ns | 298,424.6298 ns | 299,908.0760 ns | 0.16 | 0.00 | - | 10.07 kB | GlobIsMatch | Core | Core | 10000 | p?th/a[bcd]b[e-g].txt | 1,773,004.0132 ns | 799.4751 ns | 2,769.4631 ns | 1,770,939.9366 ns | 1,781,014.0571 ns | 1.00 | 0.00 | - | 10.09 kB | DotNetGlobIsMatch | Core | Core | 10000 | p?th/a[bcd]b[e-g].txt | 284,992.0625 ns | 155.9249 ns | 562.1952 ns | 283,877.9592 ns | 285,602.2289 ns | 0.16 | 0.00 | - | 10.05 kB | GlobIsMatch | Clr | Clr | 10000 | p?th/a[bcd]b[e-g]a[1-4][!wxyz][!a-c][!1-3].txt | 2,159,602.1568 ns | 4,286.3447 ns | 14,848.3336 ns | 2,137,648.9367 ns | 2,196,409.8534 ns | 1.00 | 0.00 | - | 10.11 kB | DotNetGlobIsMatch | Clr | Clr | 10000 | p?th/a[bcd]b[e-g]a[1-4][!wxyz][!a-c][!1-3].txt | 303,829.4733 ns | 353.0460 ns | 1,222.9872 ns | 302,463.0668 ns | 306,855.9734 ns | 0.14 | 0.00 | - | 10.07 kB | GlobIsMatch | Core | Core | 10000 | p?th/a[bcd]b[e-g]a[1-4][!wxyz][!a-c][!1-3].txt | 2,129,500.3578 ns | 591.9697 ns | 2,134.3770 ns | 2,125,797.7916 ns | 2,132,091.8327 ns | 1.00 | 0.00 | - | 10.09 kB | DotNetGlobIsMatch | Core | Core | 10000 | p?th/a[bcd]b[e-g]a[1-4][!wxyz][!a-c][!1-3].txt | 298,531.3830 ns | 260.7386 ns | 940.1064 ns | 296,377.9787 ns | 299,960.6351 ns | 0.14 | 0.00 | - | 10.05 kB | GlobIsMatch | Clr | Clr | 10000 | p?th/a[e-g].txt | 1,535,506.8045 ns | 5,927.4406 ns | 22,956.8787 ns | 1,515,402.0728 ns | 1,579,333.1879 ns | 1.00 | 0.00 | - | 10.08 kB | DotNetGlobIsMatch | Clr | Clr | 10000 | p?th/a[e-g].txt | 299,205.5594 ns | 1,414.8655 ns | 5,293.9421 ns | 291,291.6008 ns | 310,660.9183 ns | 0.19 | 0.00 | - | 10.07 kB | GlobIsMatch | Core | Core | 10000 | p?th/a[e-g].txt | 1,570,501.5162 ns | 9,994.7536 ns | 38,709.5141 ns | 1,534,158.0193 ns | 1,639,577.3332 ns | 1.00 | 0.00 | - | 10.09 kB | DotNetGlobIsMatch | Core | Core | 10000 | p?th/a[e-g].txt | 295,060.8589 ns | 241.3602 ns | 903.0871 ns | 293,312.9078 ns | 296,644.6249 ns | 0.19 | 0.00 | - | 10.05 kB |

Clone this wiki locally