From b139a7c3df40af0b6eb5656e9ac8d1a8137e74cb Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Tue, 28 Oct 2014 21:11:58 -0700 Subject: [PATCH] README: Update perf results & add firefox, safari --- README.md | 162 ++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 133 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index ddbff3e..08333a3 100644 --- a/README.md +++ b/README.md @@ -100,45 +100,149 @@ accordingly. See perf tests in `/perf`. +`BrowserBuffer` is the browser `buffer` module (this repo). `Uint8Array` is included as a +sanity check (since `BrowserBuffer` uses `Uint8Array` under the hood, `Uint8Array` will +always be at least a bit faster). Finally, `NodeBuffer` is the node.js buffer module, +which is included to compare against. + ``` -# Chrome 33 +# Chrome 38 + +BrowserBuffer#bracket-notation x 11,457,464 ops/sec ±0.86% (66 runs sampled) bundle.js:5262 +Uint8Array#bracket-notation x 10,824,332 ops/sec ±0.74% (65 runs sampled) bundle.js:5262 +Fastest is BrowserBuffer#bracket-notation + +BrowserBuffer#concat x 450,532 ops/sec ±0.76% (68 runs sampled) bundle.js:5267 +Uint8Array#concat x 1,368,911 ops/sec ±1.50% (62 runs sampled) bundle.js:5267 +Fastest is Uint8Array#concat + +BrowserBuffer#copy(16000) x 903,001 ops/sec ±0.96% (67 runs sampled) bundle.js:5261 +Uint8Array#copy(16000) x 1,422,441 ops/sec ±1.04% (66 runs sampled) bundle.js:5261 +Fastest is Uint8Array#copy(16000) + +BrowserBuffer#copy(16) x 11,431,358 ops/sec ±0.46% (69 runs sampled) bundle.js:5261 +Uint8Array#copy(16) x 13,944,163 ops/sec ±1.12% (68 runs sampled) bundle.js:5261 +Fastest is Uint8Array#copy(16) + +BrowserBuffer#new(16000) x 106,329 ops/sec ±6.70% (44 runs sampled) bundle.js:5253 +Uint8Array#new(16000) x 131,001 ops/sec ±2.85% (31 runs sampled) bundle.js:5253 +Fastest is Uint8Array#new(16000) + +BrowserBuffer#new(16) x 1,554,491 ops/sec ±1.60% (65 runs sampled) bundle.js:5253 +Uint8Array#new(16) x 6,623,930 ops/sec ±1.66% (65 runs sampled) bundle.js:5253 +Fastest is Uint8Array#new(16) + +BrowserBuffer#readDoubleBE x 112,830 ops/sec ±0.51% (69 runs sampled) bundle.js:5274 +DataView#getFloat64 x 93,500 ops/sec ±0.57% (68 runs sampled) bundle.js:5274 +Fastest is BrowserBuffer#readDoubleBE + +BrowserBuffer#readFloatBE x 146,678 ops/sec ±0.95% (68 runs sampled) bundle.js:5274 +DataView#getFloat32 x 99,311 ops/sec ±0.41% (67 runs sampled) bundle.js:5274 +Fastest is BrowserBuffer#readFloatBE + +BrowserBuffer#readUInt32LE x 843,214 ops/sec ±0.70% (69 runs sampled) bundle.js:5274 +DataView#getUint32 x 103,024 ops/sec ±0.64% (67 runs sampled) bundle.js:5274 +Fastest is BrowserBuffer#readUInt32LE + +BrowserBuffer#slice x 1,013,941 ops/sec ±0.75% (67 runs sampled) bundle.js:5257 +Uint8Array#subarray x 1,903,928 ops/sec ±0.53% (67 runs sampled) bundle.js:5257 +Fastest is Uint8Array#subarray + +BrowserBuffer#writeFloatBE x 61,387 ops/sec ±0.90% (67 runs sampled) bundle.js:5231 +DataView#setFloat32 x 141,249 ops/sec ±0.40% (66 runs sampled) bundle.js:5231 +Fastest is DataView#setFloat32 + +# Firefox 33 + +"BrowserBuffer#bracket-notation x 20,800,421 ops/sec ±1.84% (60 runs sampled)" bundle.js:5262 +"Uint8Array#bracket-notation x 20,826,235 ops/sec ±2.02% (61 runs sampled)" bundle.js:5262 +"Fastest is BrowserBuffer#bracket-notation,Uint8Array#bracket-notation" + +"BrowserBuffer#concat x 153,076 ops/sec ±2.32% (61 runs sampled)" bundle.js:5267 +"Uint8Array#concat x 1,255,674 ops/sec ±8.65% (52 runs sampled)" bundle.js:5267 +"Fastest is Uint8Array#concat" + +"BrowserBuffer#copy(16000) x 1,105,312 ops/sec ±1.16% (63 runs sampled)" bundle.js:5261 +"Uint8Array#copy(16000) x 1,615,911 ops/sec ±0.55% (66 runs sampled)" bundle.js:5261 +"Fastest is Uint8Array#copy(16000)" + +"BrowserBuffer#copy(16) x 16,357,599 ops/sec ±0.73% (68 runs sampled)" bundle.js:5261 +"Uint8Array#copy(16) x 31,436,281 ops/sec ±1.05% (68 runs sampled)" bundle.js:5261 +"Fastest is Uint8Array#copy(16)" + +"BrowserBuffer#new(16000) x 52,995 ops/sec ±6.01% (35 runs sampled)" bundle.js:5253 +"Uint8Array#new(16000) x 87,686 ops/sec ±5.68% (45 runs sampled)" bundle.js:5253 +"Fastest is Uint8Array#new(16000)" + +"BrowserBuffer#new(16) x 252,031 ops/sec ±1.61% (66 runs sampled)" bundle.js:5253 +"Uint8Array#new(16) x 8,477,026 ops/sec ±0.49% (68 runs sampled)" bundle.js:5253 +"Fastest is Uint8Array#new(16)" + +"BrowserBuffer#readDoubleBE x 99,871 ops/sec ±0.41% (69 runs sampled)" bundle.js:5274 +"DataView#getFloat64 x 285,663 ops/sec ±0.70% (68 runs sampled)" bundle.js:5274 +"Fastest is DataView#getFloat64" + +"BrowserBuffer#readFloatBE x 115,540 ops/sec ±0.42% (69 runs sampled)" bundle.js:5274 +"DataView#getFloat32 x 288,722 ops/sec ±0.82% (68 runs sampled)" bundle.js:5274 +"Fastest is DataView#getFloat32" + +"BrowserBuffer#readUInt32LE x 633,926 ops/sec ±1.08% (67 runs sampled)" bundle.js:5274 +"DataView#getUint32 x 294,808 ops/sec ±0.79% (64 runs sampled)" bundle.js:5274 +"Fastest is BrowserBuffer#readUInt32LE" + +"BrowserBuffer#slice x 349,425 ops/sec ±0.46% (69 runs sampled)" bundle.js:5257 +"Uint8Array#subarray x 5,965,819 ops/sec ±0.60% (65 runs sampled)" bundle.js:5257 +"Fastest is Uint8Array#subarray" + +"BrowserBuffer#writeFloatBE x 59,980 ops/sec ±0.41% (67 runs sampled)" bundle.js:5231 +"DataView#setFloat32 x 317,634 ops/sec ±0.63% (68 runs sampled)" bundle.js:5231 +"Fastest is DataView#setFloat32" + +# Safari 8 + +[Log] BrowserBuffer#bracket-notation x 10,279,729 ops/sec ±2.25% (56 runs sampled) (bundle.js, line 5262) +[Log] Uint8Array#bracket-notation x 10,030,767 ops/sec ±2.23% (59 runs sampled) (bundle.js, line 5262) +[Log] Fastest is BrowserBuffer#bracket-notation,Uint8Array#bracket-notation (bundle.js, line 5265) + +[Log] BrowserBuffer#concat x 144,138 ops/sec ±1.38% (65 runs sampled) (bundle.js, line 5267) +[Log] Uint8Array#concat x 4,950,764 ops/sec ±1.70% (63 runs sampled) (bundle.js, line 5267) +[Log] Fastest is Uint8Array#concat (bundle.js, line 5270) -NewBuffer#bracket-notation x 11,194,815 ops/sec ±1.73% (64 runs sampled) -OldBuffer#bracket-notation x 9,546,694 ops/sec ±0.76% (67 runs sampled) -Fastest is NewBuffer#bracket-notation +[Log] BrowserBuffer#copy(16000) x 1,058,548 ops/sec ±1.51% (64 runs sampled) (bundle.js, line 5261) +[Log] Uint8Array#copy(16000) x 1,409,666 ops/sec ±1.17% (65 runs sampled) (bundle.js, line 5261) +[Log] Fastest is Uint8Array#copy(16000) (bundle.js, line 5264) -NewBuffer#concat x 949,714 ops/sec ±2.48% (63 runs sampled) -OldBuffer#concat x 634,906 ops/sec ±0.42% (68 runs sampled) -Fastest is NewBuffer#concat +[Log] BrowserBuffer#copy(16) x 6,282,529 ops/sec ±1.88% (58 runs sampled) (bundle.js, line 5261) +[Log] Uint8Array#copy(16) x 11,907,128 ops/sec ±2.87% (58 runs sampled) (bundle.js, line 5261) +[Log] Fastest is Uint8Array#copy(16) (bundle.js, line 5264) -NewBuffer#copy x 15,436,458 ops/sec ±1.74% (67 runs sampled) -OldBuffer#copy x 3,990,346 ops/sec ±0.42% (68 runs sampled) -Fastest is NewBuffer#copy +[Log] BrowserBuffer#new(16000) x 101,663 ops/sec ±3.89% (57 runs sampled) (bundle.js, line 5253) +[Log] Uint8Array#new(16000) x 22,050,818 ops/sec ±6.51% (46 runs sampled) (bundle.js, line 5253) +[Log] Fastest is Uint8Array#new(16000) (bundle.js, line 5256) -NewBuffer#readDoubleBE x 1,132,954 ops/sec ±2.36% (65 runs sampled) -OldBuffer#readDoubleBE x 846,337 ops/sec ±0.58% (68 runs sampled) -Fastest is NewBuffer#readDoubleBE +[Log] BrowserBuffer#new(16) x 176,072 ops/sec ±2.13% (64 runs sampled) (bundle.js, line 5253) +[Log] Uint8Array#new(16) x 24,385,731 ops/sec ±5.01% (51 runs sampled) (bundle.js, line 5253) +[Log] Fastest is Uint8Array#new(16) (bundle.js, line 5256) -NewBuffer#new x 1,419,300 ops/sec ±3.50% (66 runs sampled) -Uint8Array#new x 3,898,573 ops/sec ±0.88% (67 runs sampled) (used internally by NewBuffer) -OldBuffer#new x 2,284,568 ops/sec ±0.57% (67 runs sampled) -Fastest is Uint8Array#new +[Log] BrowserBuffer#readDoubleBE x 41,341 ops/sec ±1.06% (67 runs sampled) (bundle.js, line 5274) +[Log] DataView#getFloat64 x 322,280 ops/sec ±0.84% (68 runs sampled) (bundle.js, line 5274) +[Log] Fastest is DataView#getFloat64 (bundle.js, line 5277) -NewBuffer#readFloatBE x 1,203,763 ops/sec ±1.81% (68 runs sampled) -OldBuffer#readFloatBE x 954,923 ops/sec ±0.66% (70 runs sampled) -Fastest is NewBuffer#readFloatBE +[Log] BrowserBuffer#readFloatBE x 46,141 ops/sec ±1.06% (65 runs sampled) (bundle.js, line 5274) +[Log] DataView#getFloat32 x 337,025 ops/sec ±0.43% (69 runs sampled) (bundle.js, line 5274) +[Log] Fastest is DataView#getFloat32 (bundle.js, line 5277) -NewBuffer#readUInt32LE x 750,341 ops/sec ±1.70% (66 runs sampled) -OldBuffer#readUInt32LE x 1,408,478 ops/sec ±0.60% (68 runs sampled) -Fastest is OldBuffer#readUInt32LE +[Log] BrowserBuffer#readUInt32LE x 151,551 ops/sec ±1.02% (66 runs sampled) (bundle.js, line 5274) +[Log] DataView#getUint32 x 308,278 ops/sec ±0.94% (67 runs sampled) (bundle.js, line 5274) +[Log] Fastest is DataView#getUint32 (bundle.js, line 5277) -NewBuffer#slice x 1,802,870 ops/sec ±1.87% (64 runs sampled) -OldBuffer#slice x 1,725,928 ops/sec ±0.74% (68 runs sampled) -Fastest is NewBuffer#slice +[Log] BrowserBuffer#slice x 197,365 ops/sec ±0.95% (66 runs sampled) (bundle.js, line 5257) +[Log] Uint8Array#subarray x 9,558,024 ops/sec ±3.08% (58 runs sampled) (bundle.js, line 5257) +[Log] Fastest is Uint8Array#subarray (bundle.js, line 5260) -NewBuffer#writeFloatBE x 830,407 ops/sec ±3.09% (66 runs sampled) -OldBuffer#writeFloatBE x 508,446 ops/sec ±0.49% (69 runs sampled) -Fastest is NewBuffer#writeFloatBE +[Log] BrowserBuffer#writeFloatBE x 17,518 ops/sec ±1.03% (63 runs sampled) (bundle.js, line 5231) +[Log] DataView#setFloat32 x 319,751 ops/sec ±0.48% (68 runs sampled) (bundle.js, line 5231) +[Log] Fastest is DataView#setFloat32 (bundle.js, line 5234) # Node 0.11.14 -- 2.34.1