Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Array vs UInt8Array resizing
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Goanna/4.7 Firefox/68.0 PaleMoon/28.17.0
Browser:
Pale Moon (Firefox Variant) 28
Operating system:
Linux
Device Platform:
Desktop
Date tested:
11 months ago
Test name
Executions per second
Uint8Array
33.8 Ops/sec
Array
13.5 Ops/sec
Script Preparation code:
c = new Uint8Array([255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255])
Tests:
Uint8Array
let stream = new Uint8Array() let a = 1000 while (a --> 0) { const buf = new Uint8Array(stream.length + c.length); buf.set(stream, 0); buf.set(c, stream.length); stream = buf; }
Array
let stream = [] let a = 1000 const push = Array.prototype.push; while (a --> 0) { push.apply(stream, c) new Uint8Array(stream) }