Skip to content

Instantly share code, notes, and snippets.

@mcollina
Created November 10, 2015 22:33
Show Gist options
  • Save mcollina/5c59c057cb5b138fcd70 to your computer and use it in GitHub Desktop.
Save mcollina/5c59c057cb5b138fcd70 to your computer and use it in GitHub Desktop.
Node clearBuffer perf improvements
$ ../node common.js http
http/chunked.js
http/chunked.js num=1 size=1 c=100: 16496.27000
http/chunked.js num=1 size=64 c=100: 16891.47000
http/chunked.js num=1 size=256 c=100: 16802.94000
http/chunked.js num=4 size=1 c=100: 8066.31000
http/chunked.js num=4 size=64 c=100: 7630.74000
http/chunked.js num=4 size=256 c=100: 7591.24000
http/chunked.js num=8 size=1 c=100: 4801.81000
http/chunked.js num=8 size=64 c=100: 4770.07000
http/chunked.js num=8 size=256 c=100: 4707.94000
http/chunked.js num=16 size=1 c=100: 2709.52000
http/chunked.js num=16 size=64 c=100: 2601.59000
http/chunked.js num=16 size=256 c=100: 2486.76000
http/client-request-body.js
http/client-request-body.js dur=5 type=asc bytes=32 method=write: 7364.04818
http/client-request-body.js dur=5 type=asc bytes=32 method=end: 7123.02034
http/client-request-body.js dur=5 type=asc bytes=256 method=write: 5563.52579
http/client-request-body.js dur=5 type=asc bytes=256 method=end: 6516.68806
http/client-request-body.js dur=5 type=asc bytes=1024 method=write: 7211.40740
http/client-request-body.js dur=5 type=asc bytes=1024 method=end: 6844.04862
http/client-request-body.js dur=5 type=utf bytes=32 method=write: 7612.01781
http/client-request-body.js dur=5 type=utf bytes=32 method=end: 7195.24737
http/client-request-body.js dur=5 type=utf bytes=256 method=write: 7523.60910
http/client-request-body.js dur=5 type=utf bytes=256 method=end: 7469.27454
http/client-request-body.js dur=5 type=utf bytes=1024 method=write: 7008.44037
http/client-request-body.js dur=5 type=utf bytes=1024 method=end: 7507.27629
http/client-request-body.js dur=5 type=buf bytes=32 method=write: 7578.36245
http/client-request-body.js dur=5 type=buf bytes=32 method=end: 7319.01152
http/client-request-body.js dur=5 type=buf bytes=256 method=write: 7701.03618
http/client-request-body.js dur=5 type=buf bytes=256 method=end: 7333.77259
http/client-request-body.js dur=5 type=buf bytes=1024 method=write: 7650.27848
http/client-request-body.js dur=5 type=buf bytes=1024 method=end: 7505.18123
http/cluster.js
http/cluster.js type=bytes length=4 c=50: 30362.46000
http/cluster.js type=bytes length=4 c=500: 28746.64000
http/cluster.js type=bytes length=1024 c=50: 26542.33000
http/cluster.js type=bytes length=1024 c=500: 25809.94000
http/cluster.js type=bytes length=102400 c=50: 800.65000
http/cluster.js type=bytes length=102400 c=500: 794.96000
http/cluster.js type=buffer length=4 c=50: 25314.65000
http/cluster.js type=buffer length=4 c=500: 25270.95000
http/cluster.js type=buffer length=1024 c=50: 26537.21000
http/cluster.js type=buffer length=1024 c=500: 25153.73000
http/cluster.js type=buffer length=102400 c=50: 17359.32000
http/cluster.js type=buffer length=102400 c=500: 12204.23000
http/end-vs-write-end.js
http/end-vs-write-end.js type=asc kb=64 c=100 method=write: 4607.12000
http/end-vs-write-end.js type=asc kb=64 c=100 method=end: 5172.75000
http/end-vs-write-end.js type=asc kb=128 c=100 method=write: 2327.99000
http/end-vs-write-end.js type=asc kb=128 c=100 method=end: 2614.79000
http/end-vs-write-end.js type=asc kb=256 c=100 method=write: 1414.04000
http/end-vs-write-end.js type=asc kb=256 c=100 method=end: 1499.04000
http/end-vs-write-end.js type=asc kb=1024 c=100 method=write: 295.93000
http/end-vs-write-end.js type=asc kb=1024 c=100 method=end: 300.10000
http/end-vs-write-end.js type=utf kb=64 c=100 method=write: 5028.48000
http/end-vs-write-end.js type=utf kb=64 c=100 method=end: 5562.33000
http/end-vs-write-end.js type=utf kb=128 c=100 method=write: 2332.76000
http/end-vs-write-end.js type=utf kb=128 c=100 method=end: 2389.63000
http/end-vs-write-end.js type=utf kb=256 c=100 method=write: 1362.52000
http/end-vs-write-end.js type=utf kb=256 c=100 method=end: 1390.54000
http/end-vs-write-end.js type=utf kb=1024 c=100 method=write: 382.43000
http/end-vs-write-end.js type=utf kb=1024 c=100 method=end: 373.57000
http/end-vs-write-end.js type=buf kb=64 c=100 method=write: 8392.60000
http/end-vs-write-end.js type=buf kb=64 c=100 method=end: 8612.83000
http/end-vs-write-end.js type=buf kb=128 c=100 method=write: 7300.17000
http/end-vs-write-end.js type=buf kb=128 c=100 method=end: 7597.71000
http/end-vs-write-end.js type=buf kb=256 c=100 method=write: 5873.39000
http/end-vs-write-end.js type=buf kb=256 c=100 method=end: 6056.77000
http/end-vs-write-end.js type=buf kb=1024 c=100 method=write: 1789.35000
http/end-vs-write-end.js type=buf kb=1024 c=100 method=end: 1935.45000
http/http_server_for_chunky_client.js
http/_chunky_http_client.js len=1 num=5 type=send: 18.24830
http/_chunky_http_client.js len=1 num=50 type=send: 364.04815
http/_chunky_http_client.js len=1 num=500 type=send: 414.54745
http/_chunky_http_client.js len=1 num=2000 type=send: 411.09288
http/_chunky_http_client.js len=4 num=5 type=send: 246.69032
http/_chunky_http_client.js len=4 num=50 type=send: 363.23850
http/_chunky_http_client.js len=4 num=500 type=send: 385.80993
http/_chunky_http_client.js len=4 num=2000 type=send: 430.49494
http/_chunky_http_client.js len=8 num=5 type=send: 242.95684
http/_chunky_http_client.js len=8 num=50 type=send: 340.44758
http/_chunky_http_client.js len=8 num=500 type=send: 377.09663
http/_chunky_http_client.js len=8 num=2000 type=send: 397.65175
http/_chunky_http_client.js len=16 num=5 type=send: 245.55876
http/_chunky_http_client.js len=16 num=50 type=send: 329.66510
http/_chunky_http_client.js len=16 num=500 type=send: 398.22268
http/_chunky_http_client.js len=16 num=2000 type=send: 398.89520
http/_chunky_http_client.js len=32 num=5 type=send: 206.21869
http/_chunky_http_client.js len=32 num=50 type=send: 384.30630
http/_chunky_http_client.js len=32 num=500 type=send: 421.55724
http/_chunky_http_client.js len=32 num=2000 type=send: 446.32556
http/_chunky_http_client.js len=64 num=5 type=send: 212.63495
http/_chunky_http_client.js len=64 num=50 type=send: 345.81893
http/_chunky_http_client.js len=64 num=500 type=send: 345.95264
http/_chunky_http_client.js len=64 num=2000 type=send: 431.43597
http/_chunky_http_client.js len=128 num=5 type=send: 189.88140
http/_chunky_http_client.js len=128 num=50 type=send: 346.69911
http/_chunky_http_client.js len=128 num=500 type=send: 397.50966
http/_chunky_http_client.js len=128 num=2000 type=send: 424.59129
http/simple.js
http/simple.js type=bytes length=4 chunks=0 c=50: 11489.19000
http/simple.js type=bytes length=4 chunks=0 c=500: 10674.01000
http/simple.js type=bytes length=4 chunks=1 c=50: 9818.44000
http/simple.js type=bytes length=4 chunks=1 c=500: 9289.25000
http/simple.js type=bytes length=4 chunks=4 c=50: 6623.04000
http/simple.js type=bytes length=4 chunks=4 c=500: 6667.21000
http/simple.js type=bytes length=1024 chunks=0 c=50: 9655.39000
http/simple.js type=bytes length=1024 chunks=0 c=500: 9881.84000
http/simple.js type=bytes length=1024 chunks=1 c=50: 6931.18000
http/simple.js type=bytes length=1024 chunks=1 c=500: 6926.36000
http/simple.js type=bytes length=1024 chunks=4 c=50: 6212.59000
http/simple.js type=bytes length=1024 chunks=4 c=500: 6012.17000
http/simple.js type=bytes length=102400 chunks=0 c=50: 304.69000
http/simple.js type=bytes length=102400 chunks=0 c=500: 294.23000
http/simple.js type=bytes length=102400 chunks=1 c=50: 188.66000
http/simple.js type=bytes length=102400 chunks=1 c=500: 185.02000
http/simple.js type=bytes length=102400 chunks=4 c=50: 2339.72000
http/simple.js type=bytes length=102400 chunks=4 c=500: 1933.90000
http/simple.js type=buffer length=4 chunks=0 c=50: 10202.24000
http/simple.js type=buffer length=4 chunks=0 c=500: 8807.81000
http/simple.js type=buffer length=4 chunks=1 c=50: 9646.71000
http/simple.js type=buffer length=4 chunks=1 c=500: 9095.84000
http/simple.js type=buffer length=4 chunks=4 c=50: 7971.84000
http/simple.js type=buffer length=4 chunks=4 c=500: 7790.41000
http/simple.js type=buffer length=1024 chunks=0 c=50: 9667.99000
http/simple.js type=buffer length=1024 chunks=0 c=500: 9370.33000
http/simple.js type=buffer length=1024 chunks=1 c=50: 8713.65000
http/simple.js type=buffer length=1024 chunks=1 c=500: 8773.18000
http/simple.js type=buffer length=1024 chunks=4 c=50: 7727.30000
http/simple.js type=buffer length=1024 chunks=4 c=500: 7457.11000
http/simple.js type=buffer length=102400 chunks=0 c=50: 8052.98000
http/simple.js type=buffer length=102400 chunks=0 c=500: 7549.54000
http/simple.js type=buffer length=102400 chunks=1 c=50: 7368.28000
http/simple.js type=buffer length=102400 chunks=1 c=500: 7152.22000
http/simple.js type=buffer length=102400 chunks=4 c=50: 6465.61000
http/simple.js type=buffer length=102400 chunks=4 c=500: 5554.50000
$ ../node common.js http
http/chunked.js
http/chunked.js num=1 size=1 c=100: 16765.85000
http/chunked.js num=1 size=64 c=100: 17388.69000
http/chunked.js num=1 size=256 c=100: 17752.61000
http/chunked.js num=4 size=1 c=100: 8210.12000
http/chunked.js num=4 size=64 c=100: 7890.27000
http/chunked.js num=4 size=256 c=100: 7253.29000
http/chunked.js num=8 size=1 c=100: 4535.23000
http/chunked.js num=8 size=64 c=100: 4695.45000
http/chunked.js num=8 size=256 c=100: 4635.75000
http/chunked.js num=16 size=1 c=100: 2729.08000
http/chunked.js num=16 size=64 c=100: 2612.16000
http/chunked.js num=16 size=256 c=100: 2623.38000
http/client-request-body.js
http/client-request-body.js dur=5 type=asc bytes=32 method=write: 7214.08748
http/client-request-body.js dur=5 type=asc bytes=32 method=end: 7797.52091
http/client-request-body.js dur=5 type=asc bytes=256 method=write: 7583.09656
http/client-request-body.js dur=5 type=asc bytes=256 method=end: 7661.66983
http/client-request-body.js dur=5 type=asc bytes=1024 method=write: 7354.91135
http/client-request-body.js dur=5 type=asc bytes=1024 method=end: 7502.51314
http/client-request-body.js dur=5 type=utf bytes=32 method=write: 7528.83040
http/client-request-body.js dur=5 type=utf bytes=32 method=end: 7523.66129
http/client-request-body.js dur=5 type=utf bytes=256 method=write: 7464.67988
http/client-request-body.js dur=5 type=utf bytes=256 method=end: 7715.26068
http/client-request-body.js dur=5 type=utf bytes=1024 method=write: 7574.32351
http/client-request-body.js dur=5 type=utf bytes=1024 method=end: 7368.10736
http/client-request-body.js dur=5 type=buf bytes=32 method=write: 7224.01904
http/client-request-body.js dur=5 type=buf bytes=32 method=end: 7598.74650
http/client-request-body.js dur=5 type=buf bytes=256 method=write: 7515.71666
http/client-request-body.js dur=5 type=buf bytes=256 method=end: 7808.53495
http/client-request-body.js dur=5 type=buf bytes=1024 method=write: 7422.55072
http/client-request-body.js dur=5 type=buf bytes=1024 method=end: 7640.33633
http/cluster.js
http/cluster.js type=bytes length=4 c=50: 29049.40000
http/cluster.js type=bytes length=4 c=500: 28985.44000
http/cluster.js type=bytes length=1024 c=50: 25754.52000
http/cluster.js type=bytes length=1024 c=500: 24373.72000
http/cluster.js type=bytes length=102400 c=50: 787.26000
http/cluster.js type=bytes length=102400 c=500: 785.56000
http/cluster.js type=buffer length=4 c=50: 25962.43000
http/cluster.js type=buffer length=4 c=500: 25432.91000
http/cluster.js type=buffer length=1024 c=50: 25157.58000
http/cluster.js type=buffer length=1024 c=500: 25045.31000
http/cluster.js type=buffer length=102400 c=50: 18092.46000
http/cluster.js type=buffer length=102400 c=500: 17092.69000
http/end-vs-write-end.js
http/end-vs-write-end.js type=asc kb=64 c=100 method=write: 6890.70000
http/end-vs-write-end.js type=asc kb=64 c=100 method=end: 7754.73000
http/end-vs-write-end.js type=asc kb=128 c=100 method=write: 3598.58000
http/end-vs-write-end.js type=asc kb=128 c=100 method=end: 3730.18000
http/end-vs-write-end.js type=asc kb=256 c=100 method=write: 2168.45000
http/end-vs-write-end.js type=asc kb=256 c=100 method=end: 2225.02000
http/end-vs-write-end.js type=asc kb=1024 c=100 method=write: 439.33000
http/end-vs-write-end.js type=asc kb=1024 c=100 method=end: 449.36000
http/end-vs-write-end.js type=utf kb=64 c=100 method=write: 6695.33000
http/end-vs-write-end.js type=utf kb=64 c=100 method=end: 7159.00000
http/end-vs-write-end.js type=utf kb=128 c=100 method=write: 3164.40000
http/end-vs-write-end.js type=utf kb=128 c=100 method=end: 3305.60000
http/end-vs-write-end.js type=utf kb=256 c=100 method=write: 1900.50000
http/end-vs-write-end.js type=utf kb=256 c=100 method=end: 1915.39000
http/end-vs-write-end.js type=utf kb=1024 c=100 method=write: 553.39000
http/end-vs-write-end.js type=utf kb=1024 c=100 method=end: 554.86000
http/end-vs-write-end.js type=buf kb=64 c=100 method=write: 11612.26000
http/end-vs-write-end.js type=buf kb=64 c=100 method=end: 11771.40000
http/end-vs-write-end.js type=buf kb=128 c=100 method=write: 10705.43000
http/end-vs-write-end.js type=buf kb=128 c=100 method=end: 11558.93000
http/end-vs-write-end.js type=buf kb=256 c=100 method=write: 8622.33000
http/end-vs-write-end.js type=buf kb=256 c=100 method=end: 9073.47000
http/end-vs-write-end.js type=buf kb=1024 c=100 method=write: 2826.02000
http/end-vs-write-end.js type=buf kb=1024 c=100 method=end: 2979.28000
http/http_server_for_chunky_client.js
http/_chunky_http_client.js len=1 num=5 type=send: 35.83883
http/_chunky_http_client.js len=1 num=50 type=send: 418.65884
http/_chunky_http_client.js len=1 num=500 type=send: 508.68679
http/_chunky_http_client.js len=1 num=2000 type=send: 495.49177
http/_chunky_http_client.js len=4 num=5 type=send: 315.29402
http/_chunky_http_client.js len=4 num=50 type=send: 394.70878
http/_chunky_http_client.js len=4 num=500 type=send: 542.31108
http/_chunky_http_client.js len=4 num=2000 type=send: 543.86455
http/_chunky_http_client.js len=8 num=5 type=send: 309.35234
http/_chunky_http_client.js len=8 num=50 type=send: 452.22394
http/_chunky_http_client.js len=8 num=500 type=send: 539.01164
http/_chunky_http_client.js len=8 num=2000 type=send: 489.86981
http/_chunky_http_client.js len=16 num=5 type=send: 293.46836
http/_chunky_http_client.js len=16 num=50 type=send: 445.72315
http/_chunky_http_client.js len=16 num=500 type=send: 512.01404
http/_chunky_http_client.js len=16 num=2000 type=send: 532.72041
http/_chunky_http_client.js len=32 num=5 type=send: 292.49155
http/_chunky_http_client.js len=32 num=50 type=send: 444.09697
http/_chunky_http_client.js len=32 num=500 type=send: 484.60826
http/_chunky_http_client.js len=32 num=2000 type=send: 543.78692
http/_chunky_http_client.js len=64 num=5 type=send: 288.27594
http/_chunky_http_client.js len=64 num=50 type=send: 400.32837
http/_chunky_http_client.js len=64 num=500 type=send: 532.18206
http/_chunky_http_client.js len=64 num=2000 type=send: 539.44652
http/_chunky_http_client.js len=128 num=5 type=send: 268.69030
http/_chunky_http_client.js len=128 num=50 type=send: 299.32892
http/_chunky_http_client.js len=128 num=500 type=send: 535.55748
http/_chunky_http_client.js len=128 num=2000 type=send: 543.89769
http/simple.js
http/simple.js type=bytes length=4 chunks=0 c=50: 17281.18000
http/simple.js type=bytes length=4 chunks=0 c=500: 17577.23000
http/simple.js type=bytes length=4 chunks=1 c=50: 15870.93000
http/simple.js type=bytes length=4 chunks=1 c=500: 14744.53000
http/simple.js type=bytes length=4 chunks=4 c=50: 9329.74000
http/simple.js type=bytes length=4 chunks=4 c=500: 9405.65000
http/simple.js type=bytes length=1024 chunks=0 c=50: 16919.53000
http/simple.js type=bytes length=1024 chunks=0 c=500: 16149.41000
http/simple.js type=bytes length=1024 chunks=1 c=50: 11188.75000
http/simple.js type=bytes length=1024 chunks=1 c=500: 10435.97000
http/simple.js type=bytes length=1024 chunks=4 c=50: 7924.31000
http/simple.js type=bytes length=1024 chunks=4 c=500: 7901.17000
http/simple.js type=bytes length=102400 chunks=0 c=50: 437.51000
http/simple.js type=bytes length=102400 chunks=0 c=500: 427.68000
http/simple.js type=bytes length=102400 chunks=1 c=50: 255.58000
http/simple.js type=bytes length=102400 chunks=1 c=500: 248.93000
http/simple.js type=bytes length=102400 chunks=4 c=50: 3638.90000
http/simple.js type=bytes length=102400 chunks=4 c=500: 2773.76000
http/simple.js type=buffer length=4 chunks=0 c=50: 16104.59000
http/simple.js type=buffer length=4 chunks=0 c=500: 14618.75000
http/simple.js type=buffer length=4 chunks=1 c=50: 15692.03000
http/simple.js type=buffer length=4 chunks=1 c=500: 15213.86000
http/simple.js type=buffer length=4 chunks=4 c=50: 13270.36000
http/simple.js type=buffer length=4 chunks=4 c=500: 12662.66000
http/simple.js type=buffer length=1024 chunks=0 c=50: 16273.52000
http/simple.js type=buffer length=1024 chunks=0 c=500: 15346.38000
http/simple.js type=buffer length=1024 chunks=1 c=50: 15915.41000
http/simple.js type=buffer length=1024 chunks=1 c=500: 15332.01000
http/simple.js type=buffer length=1024 chunks=4 c=50: 12921.60000
http/simple.js type=buffer length=1024 chunks=4 c=500: 11609.80000
http/simple.js type=buffer length=102400 chunks=0 c=50: 11223.99000
http/simple.js type=buffer length=102400 chunks=0 c=500: 10878.40000
http/simple.js type=buffer length=102400 chunks=1 c=50: 10689.14000
http/simple.js type=buffer length=102400 chunks=1 c=500: 10156.49000
http/simple.js type=buffer length=102400 chunks=4 c=50: 8485.27000
http/simple.js type=buffer length=102400 chunks=4 c=500: 8035.62000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment