mranney/node_redis — Issue #179: multi_bench.js, is it me or strings are always faster?
Author: twojcik
Created: 2012-03-01 23:05:50+00:00
State: open

Hi,
I run node_redis benchmark (resutls below) and it looks like that using strings instead of buffers is always win, is it me doing something wrong, or buffers are always slower or maybe faster only for very large values (few MB's ?)?

Client count: 5, node version: 0.6.5, server version: 2.9.5, parser: hiredis
PING, 1/5 min/max/avg/p95: 0/ 10/ 0.05/ 1.00 1146ms total, 17452.01 ops/sec
PING, 50/5 min/max/avg/p95: 0/ 10/ 2.14/ 4.00 857ms total, 23337.22 ops/sec
PING, 200/5 min/max/avg/p95: 1/ 18/ 6.83/ 11.00 686ms total, 29154.52 ops/sec
PING, 20000/5 min/max/avg/p95: 36/ 548/ 294.59/ 501.00 554ms total, 36101.08 ops/sec
SET small str, 1/5 min/max/avg/p95: 0/ 3/ 0.06/ 0.00 1177ms total, 16992.35 ops/sec
SET small str, 50/5 min/max/avg/p95: 0/ 14/ 1.84/ 3.00 740ms total, 27027.03 ops/sec
SET small str, 200/5 min/max/avg/p95: 1/ 22/ 6.98/ 11.00 701ms total, 28530.67 ops/sec
SET small str, 20000/5 min/max/avg/p95: 37/ 554/ 305.60/ 519.00 561ms total, 35650.62 ops/sec
SET small buf, 1/5 min/max/avg/p95: 0/ 11/ 0.11/ 1.00 2347ms total, 8521.52 ops/sec
SET small buf, 50/5 min/max/avg/p95: 0/ 24/ 5.38/ 10.00 2156ms total, 9276.44 ops/sec
SET small buf, 200/5 min/max/avg/p95: 0/ 42/ 18.63/ 30.00 1871ms total, 10689.47 ops/sec
SET small buf, 20000/5 min/max/avg/p95: 463/2108/1273.72/2010.55 2114ms total, 9460.74 ops/sec
GET small str, 1/5 min/max/avg/p95: 0/ 3/ 0.05/ 1.00 1096ms total, 18248.18 ops/sec
GET small str, 50/5 min/max/avg/p95: 0/ 7/ 1.67/ 3.00 671ms total, 29806.26 ops/sec
GET small str, 200/5 min/max/avg/p95: 0/ 32/ 6.47/ 10.00 650ms total, 30769.23 ops/sec
GET small str, 20000/5 min/max/avg/p95: 37/ 507/ 267.40/ 453.00 513ms total, 38986.35 ops/sec
GET small buf, 1/5 min/max/avg/p95: 0/ 3/ 0.05/ 0.00 1112ms total, 17985.61 ops/sec
GET small buf, 50/5 min/max/avg/p95: 0/ 14/ 1.74/ 3.00 698ms total, 28653.30 ops/sec
GET small buf, 200/5 min/max/avg/p95: 1/ 22/ 6.72/ 11.00 675ms total, 29629.63 ops/sec
GET small buf, 20000/5 min/max/avg/p95: 38/ 519/ 281.31/ 481.00 527ms total, 37950.66 ops/sec
SET large str, 1/5 min/max/avg/p95: 0/ 16/ 0.09/ 1.00 1800ms total, 11111.11 ops/sec
SET large str, 50/5 min/max/avg/p95: 0/ 15/ 2.83/ 4.00 1135ms total, 17621.15 ops/sec
SET large str, 200/5 min/max/avg/p95: 1/ 29/ 11.15/ 20.55 1119ms total, 17873.10 ops/sec
SET large str, 20000/5 min/max/avg/p95: 39/1179/ 636.62/1103.00 1186ms total, 16863.41 ops/sec
SET large buf, 1/5 min/max/avg/p95: 0/ 22/ 0.12/ 1.00 2447ms total, 8173.27 ops/sec
SET large buf, 50/5 min/max/avg/p95: 0/ 21/ 5.40/ 9.00 2163ms total, 9246.42 ops/sec
SET large buf, 200/5 min/max/avg/p95: 0/ 40/ 18.42/ 30.00 1851ms total, 10804.97 ops/sec
SET large buf, 20000/5 min/max/avg/p95: 538/2169/1363.26/2093.00 2176ms total, 9191.18 ops/sec
GET large str, 1/5 min/max/avg/p95: 0/ 14/ 0.07/ 1.00 1464ms total, 13661.20 ops/sec
GET large str, 50/5 min/max/avg/p95: 0/ 12/ 2.48/ 5.00 995ms total, 20100.50 ops/sec
GET large str, 200/5 min/max/avg/p95: 0/ 31/ 10.27/ 21.00 1032ms total, 19379.84 ops/sec
GET large str, 20000/5 min/max/avg/p95: 107/ 688/ 397.21/ 620.00 752ms total, 26595.74 ops/sec
GET large buf, 1/5 min/max/avg/p95: 0/ 9/ 0.07/ 1.00 1490ms total, 13422.82 ops/sec
GET large buf, 50/5 min/max/avg/p95: 0/ 11/ 2.33/ 4.00 933ms total, 21436.23 ops/sec
GET large buf, 200/5 min/max/avg/p95: 0/ 25/ 9.12/ 17.00 916ms total, 21834.06 ops/sec
GET large buf, 20000/5 min/max/avg/p95: 103/ 689/ 399.03/ 609.55 750ms total, 26666.67 ops/sec
INCR, 1/5 min/max/avg/p95: 0/ 11/ 0.05/ 1.00 1099ms total, 18198.36 ops/sec
INCR, 50/5 min/max/avg/p95: 0/ 13/ 1.66/ 3.00 665ms total, 30075.19 ops/sec
INCR, 200/5 min/max/avg/p95: 1/ 15/ 6.43/ 10.00 645ms total, 31007.75 ops/sec
INCR, 20000/5 min/max/avg/p95: 51/ 499/ 271.45/ 467.55 505ms total, 39603.96 ops/sec
LPUSH, 1/5 min/max/avg/p95: 0/ 10/ 0.05/ 0.00 1129ms total, 17714.79 ops/sec
LPUSH, 50/5 min/max/avg/p95: 0/ 18/ 1.67/ 3.00 668ms total, 29940.12 ops/sec
LPUSH, 200/5 min/max/avg/p95: 1/ 20/ 6.40/ 10.00 643ms total, 31104.20 ops/sec
LPUSH, 20000/5 min/max/avg/p95: 37/ 509/ 282.09/ 474.00 516ms total, 38759.69 ops/sec
LRANGE 10, 1/5 min/max/avg/p95: 0/ 5/ 0.09/ 1.00 1880ms total, 10638.30 ops/sec
LRANGE 10, 50/5 min/max/avg/p95: 0/ 12/ 1.82/ 3.00 729ms total, 27434.84 ops/sec
LRANGE 10, 200/5 min/max/avg/p95: 0/ 21/ 7.09/ 11.00 712ms total, 28089.89 ops/sec
LRANGE 10, 20000/5 min/max/avg/p95: 46/ 547/ 299.72/ 493.00 562ms total, 35587.19 ops/sec
LRANGE 100, 1/5 min/max/avg/p95: 0/ 13/ 0.13/ 1.00 2754ms total, 7262.16 ops/sec
LRANGE 100, 50/5 min/max/avg/p95: 0/ 13/ 2.77/ 4.00 1110ms total, 18018.02 ops/sec
LRANGE 100, 200/5 min/max/avg/p95: 1/ 37/ 11.81/ 24.00 1186ms total, 16863.41 ops/sec
LRANGE 100, 20000/5 min/max/avg/p95: 263/ 989/ 735.98/ 954.55 1107ms total, 18066.85 ops/sec