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 (Android 15; Mobile; rv:144.0) Gecko/144.0 Firefox/144.0
Browser:
Firefox Mobile 144
Operating system:
Android
Device Platform:
Mobile
Date tested:
6 months ago
Test name
Executions per second
Uint8Array
244.0 Ops/sec
Array
49.8 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) }