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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Browser:
Chrome 131
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Uint8Array
208.2 Ops/sec
Array
92.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) }