Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Node redis benchmark, comparing hiredis and faster parsers. Running on Ubuntu 12.04 on Windows 8 Hyper-V.

View hiredis.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
Client count: 5, node version: 0.8.11, server version: 2.4.17, parser: hiredis
PING, 1/5 min/max/avg/p95: 0/ 8/ 0.08/ 1.00 1620ms total, 12345.68 ops/sec
PING, 50/5 min/max/avg/p95: 0/ 7/ 1.75/ 3.00 703ms total, 28449.50 ops/sec
PING, 200/5 min/max/avg/p95: 1/ 14/ 6.65/ 11.00 667ms total, 29985.01 ops/sec
PING, 20000/5 min/max/avg/p95: 37/ 361/ 201.48/ 317.55 385ms total, 51948.05 ops/sec
SET small str, 1/5 min/max/avg/p95: 0/ 8/ 0.08/ 1.00 1760ms total, 11363.64 ops/sec
SET small str, 50/5 min/max/avg/p95: 0/ 6/ 1.96/ 3.00 786ms total, 25445.29 ops/sec
SET small str, 200/5 min/max/avg/p95: 0/ 14/ 6.85/ 11.00 687ms total, 29112.08 ops/sec
SET small str, 20000/5 min/max/avg/p95: 36/ 406/ 229.36/ 368.00 429ms total, 46620.05 ops/sec
SET small buf, 1/5 min/max/avg/p95: 0/ 7/ 0.12/ 1.00 2508ms total, 7974.48 ops/sec
SET small buf, 50/5 min/max/avg/p95: 1/ 16/ 5.30/ 9.00 2123ms total, 9420.63 ops/sec
SET small buf, 200/5 min/max/avg/p95: 0/ 42/ 19.20/ 31.00 1928ms total, 10373.44 ops/sec
SET small buf, 20000/5 min/max/avg/p95: 106/1556/ 846.62/1433.10 1577ms total, 12682.31 ops/sec
GET small str, 1/5 min/max/avg/p95: 0/ 6/ 0.08/ 1.00 1703ms total, 11743.98 ops/sec
GET small str, 50/5 min/max/avg/p95: 0/ 7/ 2.08/ 4.00 834ms total, 23980.82 ops/sec
GET small str, 200/5 min/max/avg/p95: 0/ 19/ 7.81/ 13.00 783ms total, 25542.78 ops/sec
GET small str, 20000/5 min/max/avg/p95: 40/ 423/ 231.30/ 371.55 442ms total, 45248.87 ops/sec
GET small buf, 1/5 min/max/avg/p95: 0/ 6/ 0.08/ 1.00 1730ms total, 11560.69 ops/sec
GET small buf, 50/5 min/max/avg/p95: 0/ 8/ 1.89/ 3.00 760ms total, 26315.79 ops/sec
GET small buf, 200/5 min/max/avg/p95: 0/ 19/ 7.28/ 12.00 730ms total, 27397.26 ops/sec
GET small buf, 20000/5 min/max/avg/p95: 44/ 412/ 230.36/ 363.55 430ms total, 46511.63 ops/sec
SET large str, 1/5 min/max/avg/p95: 0/ 5/ 0.09/ 1.00 1807ms total, 11068.07 ops/sec
SET large str, 50/5 min/max/avg/p95: 0/ 8/ 2.17/ 4.00 870ms total, 22988.51 ops/sec
SET large str, 200/5 min/max/avg/p95: 1/ 19/ 8.24/ 13.00 826ms total, 24213.08 ops/sec
SET large str, 20000/5 min/max/avg/p95: 60/ 609/ 341.34/ 546.55 626ms total, 31948.88 ops/sec
SET large buf, 1/5 min/max/avg/p95: 0/ 8/ 0.13/ 1.00 2634ms total, 7593.01 ops/sec
SET large buf, 50/5 min/max/avg/p95: 1/ 12/ 4.90/ 8.00 1965ms total, 10178.12 ops/sec
SET large buf, 200/5 min/max/avg/p95: 1/ 39/ 18.96/ 31.00 1904ms total, 10504.20 ops/sec
SET large buf, 20000/5 min/max/avg/p95: 108/1561/ 845.68/1465.55 1578ms total, 12674.27 ops/sec
GET large str, 1/5 min/max/avg/p95: 0/ 5/ 0.09/ 1.00 1858ms total, 10764.26 ops/sec
GET large str, 50/5 min/max/avg/p95: 0/ 12/ 2.52/ 5.00 1011ms total, 19782.39 ops/sec
GET large str, 200/5 min/max/avg/p95: 0/ 27/ 10.09/ 18.00 1013ms total, 19743.34 ops/sec
GET large str, 20000/5 min/max/avg/p95: 292/ 400/ 356.63/ 385.00 657ms total, 30441.40 ops/sec
GET large buf, 1/5 min/max/avg/p95: 0/ 4/ 0.09/ 1.00 1885ms total, 10610.08 ops/sec
GET large buf, 50/5 min/max/avg/p95: 0/ 8/ 2.36/ 4.00 947ms total, 21119.32 ops/sec
GET large buf, 200/5 min/max/avg/p95: 0/ 21/ 9.21/ 17.00 924ms total, 21645.02 ops/sec
GET large buf, 20000/5 min/max/avg/p95: 257/ 364/ 312.35/ 349.55 580ms total, 34482.76 ops/sec
INCR, 1/5 min/max/avg/p95: 0/ 3/ 0.08/ 1.00 1687ms total, 11855.36 ops/sec
INCR, 50/5 min/max/avg/p95: 0/ 9/ 1.87/ 3.00 751ms total, 26631.16 ops/sec
INCR, 200/5 min/max/avg/p95: 0/ 22/ 7.42/ 12.00 745ms total, 26845.64 ops/sec
INCR, 20000/5 min/max/avg/p95: 38/ 405/ 221.75/ 368.00 427ms total, 46838.41 ops/sec
LPUSH, 1/5 min/max/avg/p95: 0/ 3/ 0.08/ 1.00 1683ms total, 11883.54 ops/sec
LPUSH, 50/5 min/max/avg/p95: 0/ 10/ 1.83/ 3.00 734ms total, 27247.96 ops/sec
LPUSH, 200/5 min/max/avg/p95: 0/ 14/ 6.85/ 11.00 687ms total, 29112.08 ops/sec
LPUSH, 20000/5 min/max/avg/p95: 37/ 385/ 213.30/ 349.00 402ms total, 49751.24 ops/sec
LRANGE 10, 1/5 min/max/avg/p95: 0/ 5/ 0.09/ 1.00 1849ms total, 10816.66 ops/sec
LRANGE 10, 50/5 min/max/avg/p95: 0/ 7/ 2.00/ 3.00 801ms total, 24968.79 ops/sec
LRANGE 10, 200/5 min/max/avg/p95: 1/ 18/ 7.74/ 13.00 778ms total, 25706.94 ops/sec
LRANGE 10, 20000/5 min/max/avg/p95: 46/ 449/ 248.82/ 401.65 476ms total, 42016.81 ops/sec
LRANGE 100, 1/5 min/max/avg/p95: 0/ 5/ 0.12/ 1.00 2556ms total, 7824.73 ops/sec
LRANGE 100, 50/5 min/max/avg/p95: 0/ 11/ 3.04/ 5.00 1220ms total, 16393.44 ops/sec
LRANGE 100, 200/5 min/max/avg/p95: 0/ 31/ 11.47/ 21.00 1151ms total, 17376.19 ops/sec
LRANGE 100, 20000/5 min/max/avg/p95: 206/ 903/ 680.20/ 874.55 1049ms total, 19065.78 ops/sec
End of tests.
View hiredis.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
Client count: 5, node version: 0.8.11, server version: 2.4.17, parser: faster
PING, 1/5 min/max/avg/p95: 0/ 6/ 0.08/ 1.00 1637ms total, 12217.47 ops/sec
PING, 50/5 min/max/avg/p95: 0/ 7/ 1.67/ 3.00 672ms total, 29761.90 ops/sec
PING, 200/5 min/max/avg/p95: 1/ 13/ 6.36/ 10.00 638ms total, 31347.96 ops/sec
PING, 20000/5 min/max/avg/p95: 33/ 386/ 213.25/ 340.00 400ms total, 50000.00 ops/sec
SET small str, 1/5 min/max/avg/p95: 0/ 9/ 0.08/ 1.00 1704ms total, 11737.09 ops/sec
SET small str, 50/5 min/max/avg/p95: 0/ 7/ 1.77/ 3.00 711ms total, 28129.40 ops/sec
SET small str, 200/5 min/max/avg/p95: 0/ 15/ 6.53/ 10.55 655ms total, 30534.35 ops/sec
SET small str, 20000/5 min/max/avg/p95: 32/ 370/ 201.77/ 338.00 390ms total, 51282.05 ops/sec
SET small buf, 1/5 min/max/avg/p95: 0/ 7/ 0.12/ 1.00 2441ms total, 8193.36 ops/sec
SET small buf, 50/5 min/max/avg/p95: 0/ 16/ 4.68/ 8.00 1875ms total, 10666.67 ops/sec
SET small buf, 200/5 min/max/avg/p95: 1/ 35/ 18.31/ 29.00 1839ms total, 10875.48 ops/sec
SET small buf, 20000/5 min/max/avg/p95: 112/1890/1063.01/1796.55 1903ms total, 10509.72 ops/sec
GET small str, 1/5 min/max/avg/p95: 0/ 8/ 0.08/ 1.00 1661ms total, 12040.94 ops/sec
GET small str, 50/5 min/max/avg/p95: 0/ 6/ 1.89/ 3.00 759ms total, 26350.46 ops/sec
GET small str, 200/5 min/max/avg/p95: 0/ 16/ 7.14/ 12.00 716ms total, 27932.96 ops/sec
GET small str, 20000/5 min/max/avg/p95: 39/ 396/ 219.08/ 354.10 413ms total, 48426.15 ops/sec
GET small buf, 1/5 min/max/avg/p95: 0/ 8/ 0.08/ 1.00 1721ms total, 11621.15 ops/sec
GET small buf, 50/5 min/max/avg/p95: 0/ 11/ 1.98/ 3.00 794ms total, 25188.92 ops/sec
GET small buf, 200/5 min/max/avg/p95: 0/ 13/ 7.15/ 12.00 717ms total, 27894.00 ops/sec
GET small buf, 20000/5 min/max/avg/p95: 39/ 405/ 228.45/ 364.00 422ms total, 47393.36 ops/sec
SET large str, 1/5 min/max/avg/p95: 0/ 5/ 0.08/ 1.00 1792ms total, 11160.71 ops/sec
SET large str, 50/5 min/max/avg/p95: 0/ 10/ 2.19/ 4.00 880ms total, 22727.27 ops/sec
SET large str, 200/5 min/max/avg/p95: 0/ 22/ 8.35/ 13.00 838ms total, 23866.35 ops/sec
SET large str, 20000/5 min/max/avg/p95: 52/ 637/ 358.41/ 585.55 651ms total, 30721.97 ops/sec
SET large buf, 1/5 min/max/avg/p95: 0/ 4/ 0.13/ 1.00 2657ms total, 7527.29 ops/sec
SET large buf, 50/5 min/max/avg/p95: 0/ 14/ 4.91/ 8.00 1968ms total, 10162.60 ops/sec
SET large buf, 200/5 min/max/avg/p95: 1/ 37/ 19.07/ 31.00 1915ms total, 10443.86 ops/sec
SET large buf, 20000/5 min/max/avg/p95: 144/1648/ 905.11/1511.55 1850ms total, 10810.81 ops/sec
GET large str, 1/5 min/max/avg/p95: 0/ 4/ 0.09/ 1.00 1843ms total, 10851.87 ops/sec
GET large str, 50/5 min/max/avg/p95: 0/ 7/ 2.25/ 4.00 903ms total, 22148.39 ops/sec
GET large str, 200/5 min/max/avg/p95: 0/ 29/ 9.55/ 19.00 968ms total, 20661.16 ops/sec
GET large str, 20000/5 min/max/avg/p95: 263/ 417/ 345.47/ 397.00 651ms total, 30721.97 ops/sec
GET large buf, 1/5 min/max/avg/p95: 0/ 9/ 0.09/ 1.00 1839ms total, 10875.48 ops/sec
GET large buf, 50/5 min/max/avg/p95: 0/ 14/ 2.25/ 4.00 902ms total, 22172.95 ops/sec
GET large buf, 200/5 min/max/avg/p95: 0/ 29/ 9.49/ 21.00 952ms total, 21008.40 ops/sec
GET large buf, 20000/5 min/max/avg/p95: 245/ 426/ 341.40/ 410.00 649ms total, 30816.64 ops/sec
INCR, 1/5 min/max/avg/p95: 0/ 9/ 0.08/ 1.00 1708ms total, 11709.60 ops/sec
INCR, 50/5 min/max/avg/p95: 0/ 12/ 1.82/ 3.00 729ms total, 27434.84 ops/sec
INCR, 200/5 min/max/avg/p95: 0/ 13/ 6.64/ 11.00 667ms total, 29985.01 ops/sec
INCR, 20000/5 min/max/avg/p95: 36/ 368/ 205.38/ 321.55 391ms total, 51150.90 ops/sec
LPUSH, 1/5 min/max/avg/p95: 0/ 4/ 0.08/ 1.00 1673ms total, 11954.57 ops/sec
LPUSH, 50/5 min/max/avg/p95: 0/ 6/ 1.80/ 3.00 725ms total, 27586.21 ops/sec
LPUSH, 200/5 min/max/avg/p95: 1/ 14/ 7.02/ 11.00 704ms total, 28409.09 ops/sec
LPUSH, 20000/5 min/max/avg/p95: 43/ 377/ 207.62/ 336.00 393ms total, 50890.59 ops/sec
LRANGE 10, 1/5 min/max/avg/p95: 0/ 5/ 0.09/ 1.00 1994ms total, 10030.09 ops/sec
LRANGE 10, 50/5 min/max/avg/p95: 0/ 10/ 2.29/ 4.00 917ms total, 21810.25 ops/sec
LRANGE 10, 200/5 min/max/avg/p95: 1/ 22/ 11.28/ 20.00 1131ms total, 17683.47 ops/sec
LRANGE 10, 20000/5 min/max/avg/p95: 63/ 493/ 278.93/ 440.10 536ms total, 37313.43 ops/sec
LRANGE 100, 1/5 min/max/avg/p95: 0/ 7/ 0.17/ 1.00 3549ms total, 5635.39 ops/sec
LRANGE 100, 50/5 min/max/avg/p95: 1/ 17/ 5.26/ 8.55 2107ms total, 9492.17 ops/sec
LRANGE 100, 200/5 min/max/avg/p95: 2/ 59/ 21.01/ 38.00 2109ms total, 9483.17 ops/sec
LRANGE 100, 20000/5 min/max/avg/p95: 179/1639/1008.01/1601.10 1797ms total, 11129.66 ops/sec
End of tests.
View hiredis.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
Comparing before, hiredis.txt ( 55 lines) to after, js_faster.txt ( 55 lines)
PING: 12345 -> 12217 ops/sec ( -128 )
PING: 28449 -> 29761 ops/sec ( +1312 )
PING: 29985 -> 31347 ops/sec ( +1362 )
PING: 51948 -> 50000 ops/sec ( -1948 )
SET small str: 11363 -> 11737 ops/sec ( +374 )
SET small str: 25445 -> 28129 ops/sec ( +2684 )
SET small str: 29112 -> 30534 ops/sec ( +1422 )
SET small str: 46620 -> 51282 ops/sec ( +4662 )
SET small buf: 7974 -> 8193 ops/sec ( +219 )
SET small buf: 9420 -> 10666 ops/sec ( +1246 )
SET small buf: 10373 -> 10875 ops/sec ( +502 )
SET small buf: 12682 -> 10509 ops/sec ( -2173 )
GET small str: 11743 -> 12040 ops/sec ( +297 )
GET small str: 23980 -> 26350 ops/sec ( +2370 )
GET small str: 25542 -> 27932 ops/sec ( +2390 )
GET small str: 45248 -> 48426 ops/sec ( +3178 )
GET small buf: 11560 -> 11621 ops/sec ( +61 )
GET small buf: 26315 -> 25188 ops/sec ( -1127 )
GET small buf: 27397 -> 27894 ops/sec ( +497 )
GET small buf: 46511 -> 47393 ops/sec ( +882 )
SET large str: 11068 -> 11160 ops/sec ( +92 )
SET large str: 22988 -> 22727 ops/sec ( -261 )
SET large str: 24213 -> 23866 ops/sec ( -347 )
SET large str: 31948 -> 30721 ops/sec ( -1227 )
SET large buf: 7593 -> 7527 ops/sec ( -66 )
SET large buf: 10178 -> 10162 ops/sec ( -16 )
SET large buf: 10504 -> 10443 ops/sec ( -61 )
SET large buf: 12674 -> 10810 ops/sec ( -1864 )
GET large str: 10764 -> 10851 ops/sec ( +87 )
GET large str: 19782 -> 22148 ops/sec ( +2366 )
GET large str: 19743 -> 20661 ops/sec ( +918 )
GET large str: 30441 -> 30721 ops/sec ( +280 )
GET large buf: 10610 -> 10875 ops/sec ( +265 )
GET large buf: 21119 -> 22172 ops/sec ( +1053 )
GET large buf: 21645 -> 21008 ops/sec ( -637 )
GET large buf: 34482 -> 30816 ops/sec ( -3666 )
INCR: 11855 -> 11709 ops/sec ( -146 )
INCR: 26631 -> 27434 ops/sec ( +803 )
INCR: 26845 -> 29985 ops/sec ( +3140 )
INCR: 46838 -> 51150 ops/sec ( +4312 )
LPUSH: 11883 -> 11954 ops/sec ( +71 )
LPUSH: 27247 -> 27586 ops/sec ( +339 )
LPUSH: 29112 -> 28409 ops/sec ( -703 )
LPUSH: 49751 -> 50890 ops/sec ( +1139 )
LRANGE 10: 10816 -> 10030 ops/sec ( -786 )
LRANGE 10: 24968 -> 21810 ops/sec ( -3158 )
LRANGE 10: 25706 -> 17683 ops/sec ( -8023 )
LRANGE 10: 42016 -> 37313 ops/sec ( -4703 )
LRANGE 100: 7824 -> 5635 ops/sec ( -2189 )
LRANGE 100: 16393 -> 9492 ops/sec ( -6901 )
LRANGE 100: 17376 -> 9483 ops/sec ( -7893 )
LRANGE 100: 19065 -> 11129 ops/sec ( -7936 )
Mean difference in ops/sec: -339.1538461538462
View hiredis.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14
OS: Ubuntu 12.04 AMD64
Hypervisor: Windows 8 Hyper-V
CPU: Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz, 8 virtual processors
 
 
$ node --version
v0.8.11
 
$ gcc --version | head -n 1
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
 
$ redis-cli INFO | grep version
redis_version:2.4.17
gcc_version:4.6.3
Owner

Benchmark running on OS X:
https://gist.github.com/3879408

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.