-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Performance is comparable with the performance of strchr() for short strings. A bit worse than glibc, but glibc gets to use AVX(-512) anyway. os: FreeBSD arch: amd64 cpu: 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz │ strrchr.pre.out │ strrchr.scalar.out │ strrchr.baseline.out │ │ sec/op │ sec/op vs base │ sec/op vs base │ Short 111.51µ ± 0% 82.39µ ± 1% -26.11% (p=0.000 n=20) 45.19µ ± 0% -59.48% (p=0.000 n=20) Mid 66.19µ ± 0% 23.44µ ± 0% -64.59% (p=0.000 n=20) 10.59µ ± 0% -84.00% (p=0.000 n=20) Long 51.422µ ± 0% 15.932µ ± 0% -69.02% (p=0.000 n=20) 5.972µ ± 0% -88.39% (p=0.000 n=20) geomean 72.40µ 31.33µ -56.72% 14.19µ -80.40% │ strrchr.pre.out │ strrchr.scalar.out │ strrchr.baseline.out │ │ B/s │ B/s vs base │ B/s vs base │ Short 1.044Gi ± 0% 1.413Gi ± 1% +35.34% (p=0.000 n=20) 2.576Gi ± 0% +146.76% (p=0.000 n=20) Mid 1.759Gi ± 0% 4.967Gi ± 0% +182.42% (p=0.000 n=20) 10.996Gi ± 0% +525.18% (p=0.000 n=20) Long 2.264Gi ± 0% 7.307Gi ± 0% +222.76% (p=0.000 n=20) 19.493Gi ± 0% +761.03% (p=0.000 n=20) geomean 1.608Gi 3.715Gi +131.07% 8.204Gi +410.23% os: Linux arch: x86_64 cpu: │ strrchr.glibc.out │ │ sec/op │ Short 28.91µ ± 2% Mid 8.588µ ± 0% Long 2.113µ ± 0% geomean 8.064µ │ strrchr.glibc.out │ │ B/s │ Short 4.027Gi ± 2% Mid 13.56Gi ± 0% Long 55.10Gi ± 0% geomean 14.44Gi
- Loading branch information
1 parent
47c8952
commit 7e069e8
Showing
4 changed files
with
540 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
os: FreeBSD | ||
arch: amd64 | ||
cpu: 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz | ||
|
||
BenchmarkShort 26152 45908.265 ns/op 2722.8212 MB/s | ||
BenchmarkMid 113053 10603.782 ns/op 11788.247 MB/s | ||
BenchmarkLong 200935 5971.4852 ns/op 20932.816 MB/s | ||
os: FreeBSD | ||
arch: amd64 | ||
cpu: 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz | ||
|
||
BenchmarkShort 26365 45359.626 ns/op 2755.7546 MB/s | ||
BenchmarkMid 113116 10586.845 ns/op 11807.106 MB/s | ||
BenchmarkLong 200937 5972.7859 ns/op 20928.257 MB/s | ||
os: FreeBSD | ||
arch: amd64 | ||
cpu: 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz | ||
|
||
BenchmarkShort 26352 44961.211 ns/op 2780.1742 MB/s | ||
BenchmarkMid 112981 10584.754 ns/op 11809.439 MB/s | ||
BenchmarkLong 200952 5972.0409 ns/op 20930.868 MB/s | ||
os: FreeBSD | ||
arch: amd64 | ||
cpu: 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz | ||
|
||
BenchmarkShort 26302 45897.159 ns/op 2723.4801 MB/s | ||
BenchmarkMid 112986 10594.277 ns/op 11798.823 MB/s | ||
BenchmarkLong 200960 5971.7253 ns/op 20931.974 MB/s | ||
os: FreeBSD | ||
arch: amd64 | ||
cpu: 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz | ||
|
||
BenchmarkShort 26427 45083.237 ns/op 2772.6492 MB/s | ||
BenchmarkMid 113192 10583.767 ns/op 11810.539 MB/s | ||
BenchmarkLong 200948 5971.6301 ns/op 20932.308 MB/s | ||
os: FreeBSD | ||
arch: amd64 | ||
cpu: 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz | ||
|
||
BenchmarkShort 26376 45177.896 ns/op 2766.8398 MB/s | ||
BenchmarkMid 113181 10584.68 ns/op 11809.521 MB/s | ||
BenchmarkLong 200931 5976.1893 ns/op 20916.339 MB/s | ||
os: FreeBSD | ||
arch: amd64 | ||
cpu: 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz | ||
|
||
BenchmarkShort 26304 45002.164 ns/op 2777.6442 MB/s | ||
BenchmarkMid 113464 10586.623 ns/op 11807.354 MB/s | ||
BenchmarkLong 200944 5972.1667 ns/op 20930.427 MB/s | ||
os: FreeBSD | ||
arch: amd64 | ||
cpu: 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz | ||
|
||
BenchmarkShort 26432 45149.423 ns/op 2768.5847 MB/s | ||
BenchmarkMid 113140 10587.353 ns/op 11806.539 MB/s | ||
BenchmarkLong 200938 5972.6655 ns/op 20928.679 MB/s | ||
os: FreeBSD | ||
arch: amd64 | ||
cpu: 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz | ||
|
||
BenchmarkShort 26570 45127.071 ns/op 2769.956 MB/s | ||
BenchmarkMid 113145 10582.445 ns/op 11812.015 MB/s | ||
BenchmarkLong 200944 5972.9619 ns/op 20927.641 MB/s | ||
os: FreeBSD | ||
arch: amd64 | ||
cpu: 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz | ||
|
||
BenchmarkShort 26538 44617.446 ns/op 2801.5947 MB/s | ||
BenchmarkMid 113180 10601.601 ns/op 11790.672 MB/s | ||
BenchmarkLong 200944 5971.5677 ns/op 20932.527 MB/s | ||
os: FreeBSD | ||
arch: amd64 | ||
cpu: 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz | ||
|
||
BenchmarkShort 26455 45283.01 ns/op 2760.4172 MB/s | ||
BenchmarkMid 113248 10585.452 ns/op 11808.659 MB/s | ||
BenchmarkLong 200924 5971.6971 ns/op 20932.073 MB/s | ||
os: FreeBSD | ||
arch: amd64 | ||
cpu: 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz | ||
|
||
BenchmarkShort 26574 45096.838 ns/op 2771.8129 MB/s | ||
BenchmarkMid 113240 10579.873 ns/op 11814.887 MB/s | ||
BenchmarkLong 200925 5972.1143 ns/op 20930.611 MB/s | ||
os: FreeBSD | ||
arch: amd64 | ||
cpu: 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz | ||
|
||
BenchmarkShort 25849 46309.136 ns/op 2699.2514 MB/s | ||
BenchmarkMid 112941 10605.487 ns/op 11786.351 MB/s | ||
BenchmarkLong 200932 5974.6647 ns/op 20921.676 MB/s | ||
os: FreeBSD | ||
arch: amd64 | ||
cpu: 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz | ||
|
||
BenchmarkShort 26491 45203.993 ns/op 2765.2424 MB/s | ||
BenchmarkMid 113137 10607.375 ns/op 11784.254 MB/s | ||
BenchmarkLong 200954 5973.0989 ns/op 20927.161 MB/s | ||
os: FreeBSD | ||
arch: amd64 | ||
cpu: 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz | ||
|
||
BenchmarkShort 26259 45304.203 ns/op 2759.1259 MB/s | ||
BenchmarkMid 112798 10617.55 ns/op 11772.961 MB/s | ||
BenchmarkLong 200954 5973.8296 ns/op 20924.601 MB/s | ||
os: FreeBSD | ||
arch: amd64 | ||
cpu: 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz | ||
|
||
BenchmarkShort 26205 45523.292 ns/op 2745.8471 MB/s | ||
BenchmarkMid 113013 10578.805 ns/op 11816.079 MB/s | ||
BenchmarkLong 200952 5971.652 ns/op 20932.231 MB/s | ||
os: FreeBSD | ||
arch: amd64 | ||
cpu: 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz | ||
|
||
BenchmarkShort 26463 45095.837 ns/op 2771.8745 MB/s | ||
BenchmarkMid 113250 10597.975 ns/op 11794.706 MB/s | ||
BenchmarkLong 200941 5971.7227 ns/op 20931.983 MB/s | ||
os: FreeBSD | ||
arch: amd64 | ||
cpu: 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz | ||
|
||
BenchmarkShort 26440 45125.36 ns/op 2770.061 MB/s | ||
BenchmarkMid 113242 10576.4 ns/op 11818.766 MB/s | ||
BenchmarkLong 200929 5972.5662 ns/op 20929.027 MB/s | ||
os: FreeBSD | ||
arch: amd64 | ||
cpu: 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz | ||
|
||
BenchmarkShort 26330 45329.172 ns/op 2757.6061 MB/s | ||
BenchmarkMid 113187 10582.736 ns/op 11811.691 MB/s | ||
BenchmarkLong 200925 5972.0904 ns/op 20930.695 MB/s | ||
os: FreeBSD | ||
arch: amd64 | ||
cpu: 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz | ||
|
||
BenchmarkShort 26371 45443.583 ns/op 2750.6634 MB/s | ||
BenchmarkMid 113236 10587.161 ns/op 11806.753 MB/s | ||
BenchmarkLong 200922 5972.931 ns/op 20927.749 MB/s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
os: Linux | ||
arch: x86_64 | ||
|
||
BenchmarkShort 38238 29226.048 ns/op 4277.0066 MB/s | ||
BenchmarkMid 140055 8578.1565 ns/op 14571.895 MB/s | ||
BenchmarkLong 567904 2112.2382 ns/op 59178.931 MB/s | ||
os: Linux | ||
arch: x86_64 | ||
|
||
BenchmarkShort 38173 29061.057 ns/op 4301.2888 MB/s | ||
BenchmarkMid 139858 8578.6294 ns/op 14571.092 MB/s | ||
BenchmarkLong 568536 2111.5386 ns/op 59198.54 MB/s | ||
os: Linux | ||
arch: x86_64 | ||
|
||
BenchmarkShort 38664 29519.711 ns/op 4234.4588 MB/s | ||
BenchmarkMid 139578 8613.7796 ns/op 14511.632 MB/s | ||
BenchmarkLong 568424 2114.9982 ns/op 59101.704 MB/s | ||
os: Linux | ||
arch: x86_64 | ||
|
||
BenchmarkShort 39002 28728.033 ns/op 4351.1507 MB/s | ||
BenchmarkMid 138610 8575.5794 ns/op 14576.275 MB/s | ||
BenchmarkLong 568599 2110.1206 ns/op 59238.32 MB/s | ||
os: Linux | ||
arch: x86_64 | ||
|
||
BenchmarkShort 39054 29025.213 ns/op 4306.6007 MB/s | ||
BenchmarkMid 139353 8606.0356 ns/op 14524.69 MB/s | ||
BenchmarkLong 568418 2110.9964 ns/op 59213.742 MB/s | ||
os: Linux | ||
arch: x86_64 | ||
|
||
BenchmarkShort 39380 28585.148 ns/op 4372.9002 MB/s | ||
BenchmarkMid 139514 8564.3905 ns/op 14595.318 MB/s | ||
BenchmarkLong 568029 2113.4212 ns/op 59145.805 MB/s | ||
os: Linux | ||
arch: x86_64 | ||
|
||
BenchmarkShort 38082 28774.612 ns/op 4344.1072 MB/s | ||
BenchmarkMid 138621 8608.0607 ns/op 14521.273 MB/s | ||
BenchmarkLong 568557 2115.6454 ns/op 59083.626 MB/s | ||
os: Linux | ||
arch: x86_64 | ||
|
||
BenchmarkShort 38830 29863.928 ns/op 4185.6517 MB/s | ||
BenchmarkMid 139616 8575.8572 ns/op 14575.802 MB/s | ||
BenchmarkLong 569028 2110.9141 ns/op 59216.053 MB/s | ||
os: Linux | ||
arch: x86_64 | ||
|
||
BenchmarkShort 38658 29498.097 ns/op 4237.5616 MB/s | ||
BenchmarkMid 139730 8581.7043 ns/op 14565.871 MB/s | ||
BenchmarkLong 568543 2110.7484 ns/op 59220.7 MB/s | ||
os: Linux | ||
arch: x86_64 | ||
|
||
BenchmarkShort 37101 28765.877 ns/op 4345.4263 MB/s | ||
BenchmarkMid 138890 8640.2101 ns/op 14467.241 MB/s | ||
BenchmarkLong 568923 2113.7028 ns/op 59137.925 MB/s | ||
os: Linux | ||
arch: x86_64 | ||
|
||
BenchmarkShort 39399 28006.549 ns/op 4463.2417 MB/s | ||
BenchmarkMid 139149 8593.5624 ns/op 14545.772 MB/s | ||
BenchmarkLong 567345 2113.8409 ns/op 59134.063 MB/s | ||
os: Linux | ||
arch: x86_64 | ||
|
||
BenchmarkShort 39212 29826.868 ns/op 4190.8523 MB/s | ||
BenchmarkMid 139605 8575.303 ns/op 14576.744 MB/s | ||
BenchmarkLong 568256 2115.1119 ns/op 59098.527 MB/s | ||
os: Linux | ||
arch: x86_64 | ||
|
||
BenchmarkShort 37225 29897.416 ns/op 4180.9633 MB/s | ||
BenchmarkMid 139152 8636.5871 ns/op 14473.31 MB/s | ||
BenchmarkLong 568557 2110.7831 ns/op 59219.728 MB/s | ||
os: Linux | ||
arch: x86_64 | ||
|
||
BenchmarkShort 37231 28895.913 ns/op 4325.8713 MB/s | ||
BenchmarkMid 139836 8595.0773 ns/op 14543.208 MB/s | ||
BenchmarkLong 568269 2118.1782 ns/op 59012.977 MB/s | ||
os: Linux | ||
arch: x86_64 | ||
|
||
BenchmarkShort 39154 28578.983 ns/op 4373.8436 MB/s | ||
BenchmarkMid 139032 8580.0686 ns/op 14568.648 MB/s | ||
BenchmarkLong 568614 2113.2042 ns/op 59151.878 MB/s | ||
os: Linux | ||
arch: x86_64 | ||
|
||
BenchmarkShort 39487 28504.785 ns/op 4385.2286 MB/s | ||
BenchmarkMid 140702 8573.706 ns/op 14579.46 MB/s | ||
BenchmarkLong 568054 2111.5034 ns/op 59199.527 MB/s | ||
os: Linux | ||
arch: x86_64 | ||
|
||
BenchmarkShort 38640 29952.295 ns/op 4173.3029 MB/s | ||
BenchmarkMid 139438 8584.0041 ns/op 14561.969 MB/s | ||
BenchmarkLong 568807 2110.7989 ns/op 59219.284 MB/s | ||
os: Linux | ||
arch: x86_64 | ||
|
||
BenchmarkShort 38700 28686.516 ns/op 4357.448 MB/s | ||
BenchmarkMid 139087 8603.3434 ns/op 14529.235 MB/s | ||
BenchmarkLong 568756 2110.9558 ns/op 59214.884 MB/s | ||
os: Linux | ||
arch: x86_64 | ||
|
||
BenchmarkShort 38703 28915.271 ns/op 4322.9752 MB/s | ||
BenchmarkMid 139833 8591.8214 ns/op 14548.72 MB/s | ||
BenchmarkLong 568588 2114.8074 ns/op 59107.036 MB/s | ||
os: Linux | ||
arch: x86_64 | ||
|
||
BenchmarkShort 38068 28573.535 ns/op 4374.6775 MB/s | ||
BenchmarkMid 139047 8605.4653 ns/op 14525.653 MB/s | ||
BenchmarkLong 568904 2113.5654 ns/op 59141.77 MB/s |
Oops, something went wrong.