Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
parse list of bytes
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:132.0) Gecko/20100101 Firefox/132.0
Browser:
Firefox 132
Operating system:
Ubuntu
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
split
50670.1 Ops/sec
split no init size
47512.2 Ops/sec
byte array
67909.8 Ops/sec
json nonsense
48067.9 Ops/sec
Script Preparation code:
function makeString() { return Array.from(Array(1000)) .map(() => (Math.random() * 256) | 0) .join(","); } var str = makeString(); window.output=null;
Tests:
split
const uintStrings = str.split(","); const len = uintStrings.length; const uintArray = new Array(len); for (let i = 0; i < len; ++i) { uintArray[i] = parseInt(uintStrings[i]); } window.output= uintArray;
split no init size
const uintStrings = str.split(","); const len = uintStrings.length; const uintArray = new Array(); for (let i = 0; i < len; ++i) { uintArray[i] = parseInt(uintStrings[i]); } window.output=uintArray;
byte array
const uintStrings = str.split(","); const len = uintStrings.length; const uintArray = new Uint8Array(len); for (let i = 0; i < len; ++i) { uintArray[i] = parseInt(uintStrings[i]); } window.output=uintArray;
json nonsense
window.output=JSON.parse(`[${str}]`);