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 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Mobile Safari/537.36
Browser:
Chrome Mobile 123
Operating system:
Android
Device Platform:
Mobile
Date tested:
2 years ago
Test name
Executions per second
Uint8Array
46.9 Ops/sec
Array
11.7 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) }