Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
255 lines (234 sloc) 8.47 KB
# Benchmark results for Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz, GCC 6.2.1
rm -f *.o* *~ str_benchmark
gcc -march=native -mtune=native -O3 -c strspn.c -o strspn.o
gcc -march=native -mtune=native -O3 -c strcasecmp.c -o strcasecmp.o
g++ -c benchmark.cc -o benchmark.o
g++ -o str_benchmark strspn.o strcasecmp.o benchmark.o
./str_benchmark
test strcasecmp("", "")
test strcasecmp("", "a")
test strcasecmp("/!", "")
test strcasecmp("/!", "abc")
test strcasecmp("ABC", "abc")
test strcasecmp("AbCdE", "abcde")
test strcasecmp("AbCdEm", "abcde")
test strcasecmp("AbCdE", "axcde")
test strcasecmp("0123456789abcdefghijklmno", "0123456789abcdefghijklmno")
test strcasecmp("0123456789abcdefghijkLmno", "0123456789abcdefghijkLmn0")
test strcasecmp("0123456789_0123456789_0123456789_zxfghert", "012345678")
test strcasecmp("0123456789_0123456789_0123456789_zxfghert", "0_zxfghrt")
test strcasecmp("0123456789_0123456789_0123456789_zXfGhERT", "0123456789_0123456789_0123456789_zxfghert")
test strcasecmp("0123456789_0123456789_0123456789_zXfGhERT", "0123456789_0123456789_0123456789t_zxfghert")
test strcasecmp("mozilla!5.0_(windows_nt_6.1!_wow64)_applewebkit!535.11_(khtml._like_gecko)_chrome!17.0.963.56_safari!535.11", "mozilla!5.0_(windows_nt_6.1!_wow64)_applewebkit!535.11_(khtml._like_gecko)_chrome!17.0.963.56_safari!535.11")
test strcasecmp("mozilla!5.0_(windows_nt_6.1!_wow64)_applewebkit!535.11_(khtml._like_gecko)_chrome!17.0.963.56_safari!535.11", "Internet Explorer!5.0_(windows_nt_6.1!_wow64)_applewebkit!535.11_(khtml._like_gecko)_chrome!17.0.963.56_safari!535.11")
test strspn("")
test strspn("a")
test strspn("ab")
test strspn("abc")
test strspn("abcd")
test strspn("abcde")
test strspn(" ")
test strspn("{a")
test strspn("a}b")
test strspn("abc}")
test strspn(""abce")
test strspn("heLLo_24!")
test strspn("!#$%&'*+-._();^abcde")
test strspn("0123456789abcdefghIjkl|\Pmdsfdfew34////")
test strspn("0123456789abcdefghIjkl@?Pmdsfdfew34//^//")
test strspn("0123456789_0123456789_0123456789_0123456789_|abcdef")
test strspn("0123456789_0123456789_^0123456789_0123456789_abcdef")
test strspn("0123456789_0123456789_0123456789_0123456789_abcdef^")
test strspn("mozilla!5.0_(windows_nt_6.1!_wow64)_applewebkit!535.11_(khtml._like_gecko)_chrome!17.0.963.56_safari!535.11")
test strspn("mozilla!5.0_(windows_nt_6.1!_wow64)_applewebkit!535.^11_(khtml._like_gecko)_chrome!17.0.963.56_safari!535.11")
test strspn("mozilla!5.0_(windows_nt_6.1!_wow64)_applewebkit!535.11_(khtml._like_gecko)_chrome!17.^0.963.56_safari!535.11")
Linux kernel strcasecmp():
str_len 1: 144ms
str_len 3: 151ms
str_len 10: 176ms
str_len 19: 206ms
str_len 28: 289ms
str_len 107: 552ms
str_len 178: 786ms
str_len 1023: 3536ms
str_len 1500: 5094ms
Linux kernel strncasecmp():
str_len 1: 142ms
str_len 3: 139ms
str_len 10: 168ms
str_len 19: 211ms
str_len 28: 312ms
str_len 107: 669ms
str_len 178: 1017ms
str_len 1023: 5145ms
str_len 1500: 7477ms
GLIBC strcasecmp():
str_len 1: 148ms
str_len 3: 148ms
str_len 10: 148ms
str_len 19: 168ms
str_len 28: 168ms
str_len 107: 213ms
str_len 178: 255ms
str_len 1023: 870ms
str_len 1500: 1167ms
GLIBC strncasecmp():
str_len 1: 133ms
str_len 3: 144ms
str_len 10: 143ms
str_len 19: 163ms
str_len 28: 168ms
str_len 107: 213ms
str_len 178: 253ms
str_len 1023: 861ms
str_len 1500: 1167ms
AVX2 strncasecmp():
str_len 1: 127ms
str_len 3: 131ms
str_len 10: 178ms
str_len 19: 206ms
str_len 28: 235ms
str_len 107: 199ms
str_len 178: 254ms
str_len 1023: 558ms
str_len 1500: 673ms
AVX2/64bit strncasecmp():
str_len 1: 121ms
str_len 3: 132ms
str_len 10: 166ms
str_len 19: 194ms
str_len 28: 227ms
str_len 107: 189ms
str_len 178: 236ms
str_len 1023: 463ms
str_len 1500: 588ms
AVX2 XOR strncasecmp():
str_len 1: 171ms
str_len 3: 171ms
str_len 10: 198ms
str_len 19: 219ms
str_len 28: 241ms
str_len 107: 220ms
str_len 178: 250ms
str_len 1023: 518ms
str_len 1500: 636ms
AVX2 XOR/64bit strncasecmp():
str_len 1: 127ms
str_len 3: 132ms
str_len 10: 131ms
str_len 19: 147ms
str_len 28: 148ms
str_len 107: 164ms
str_len 178: 188ms
str_len 1023: 367ms
str_len 1500: 462ms
AVX2/64bit strncasecmp(), one string case conversion:
str_len 1: 126ms
str_len 3: 129ms
str_len 10: 129ms
str_len 19: 133ms
str_len 28: 136ms
str_len 107: 154ms
str_len 178: 179ms
str_len 1023: 310ms
str_len 1500: 376ms
Linux kernel strspn():
str_len 1: 324ms
str_len 3: 641ms
str_len 10: 1865ms
str_len 19: 3565ms
str_len 28: 4522ms
str_len 107: 18851ms
str_len 178: 28575ms
str_len 1023: 187992ms
str_len 1500: 273276ms
Tempesta original memchreol():
str_len 1: 124ms
str_len 3: 129ms
str_len 10: 153ms
str_len 19: 228ms
str_len 28: 252ms
str_len 107: 473ms
str_len 178: 664ms
str_len 1023: 2953ms
str_len 1500: 4248ms
Tempesta SIMD memchreol():
str_len 1: 122ms
str_len 3: 134ms
str_len 10: 183ms
str_len 19: 155ms
str_len 28: 196ms
str_len 107: 200ms
str_len 178: 187ms
str_len 1023: 385ms
str_len 1500: 454ms
GLIBC strspn():
str_len 1: 350ms
str_len 3: 354ms
str_len 10: 380ms
str_len 19: 420ms
str_len 28: 398ms
str_len 107: 533ms
str_len 178: 650ms
str_len 1023: 2071ms
str_len 1500: 2856ms
GLIBC memchr():
str_len 1: 125ms
str_len 3: 125ms
str_len 10: 125ms
str_len 19: 133ms
str_len 28: 137ms
str_len 107: 145ms
str_len 178: 165ms
str_len 1023: 280ms
str_len 1500: 342ms
C string scanning:
str_len 1: 122ms
str_len 3: 125ms
str_len 10: 146ms
str_len 19: 167ms
str_len 28: 186ms
str_len 107: 348ms
str_len 178: 474ms
str_len 1023: 1849ms
str_len 1500: 2624ms
PCMPESTRI/PicoHTTPParser:
str_len 1: 128ms
str_len 3: 138ms
str_len 10: 161ms
str_len 19: 151ms
str_len 28: 183ms
str_len 107: 218ms
str_len 178: 230ms
str_len 1023: 784ms
str_len 1500: 1069ms
AVX2/CloudFlare:
str_len 1: 171ms
str_len 3: 175ms
str_len 10: 189ms
str_len 19: 174ms
str_len 28: 196ms
str_len 107: 198ms
str_len 178: 203ms
str_len 1023: 375ms
str_len 1500: 458ms
Tempesta AVX2 URI matching:
str_len 1: 124ms
str_len 3: 128ms
str_len 10: 149ms
str_len 19: 165ms
str_len 28: 181ms
str_len 107: 194ms
str_len 178: 226ms
str_len 1023: 411ms
str_len 1500: 522ms
Tempesta AVX2 constant URI matching:
str_len 1: 123ms
str_len 3: 127ms
str_len 10: 150ms
str_len 19: 139ms
str_len 28: 156ms
str_len 107: 167ms
str_len 178: 180ms
str_len 1023: 350ms
str_len 1500: 433ms