Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
uint8array separate extract vs uint8 interleave extract
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (iPhone; CPU iPhone OS 17_2_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.2 Mobile/15E148 Safari/604.1
Browser:
Mobile Safari 17
Operating system:
iOS 17.2.1
Device Platform:
Mobile
Date tested:
2 years ago
Test name
Executions per second
interleave
1263611.9 Ops/sec
separate
1259418.0 Ops/sec
Script Preparation code:
function generateRandomUint8Array(length) { const array = new Uint8Array(length); window.crypto.getRandomValues(array); return array; } function readInt64LE(bytes, offset) { return (bytes[offset] | (bytes[offset + 1] << 8) | (bytes[offset + 2] << 16) | (bytes[offset + 3] << 24) | (bytes[offset + 4] << 32) | (bytes[offset + 5] << 40)) >>> 0; }
Tests:
interleave
// Example usage: const bytes = generateRandomUint8Array(120); let sp = [] for (let i = 0; i < 8; ++i) { let id = readInt64LE(bytes, (i * 10) + 8); // imageset id [8] let imgIdx0 = bytes[(i * 10) + 16]; // image index 0 [9] let imgIdx1 = bytes[(i * 10) + 17]; // image index 1 [10] sp.push([id, imgIdx0, imgIdx1]) }
separate
// Example usage: const bytes = generateRandomUint8Array(120); let sp = [] for (let i = 0; i < 8; ++i) { let id = readInt64LE(bytes, (i << 3) + 8); // imageset id [8] sp.push(id) } for (let i = 0; i < 8; ++i) { let imgIdx0 = bytes[i+72]; sp.push(imgIdx0) } for (let i = 0; i < 8; ++i) { let imgIdx1 = bytes[i+80]; sp.push(imgIdx1) }