Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
uint8array 8 extract vs uint8 10 extract
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36
Browser:
Chrome 121
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
2 years ago
Test name
Executions per second
10 byte
720738.6 Ops/sec
8 byte
721989.1 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:
10 byte
// 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]) }
8 byte
// Example usage: const bytes = generateRandomUint8Array(120); let sp = [] for (let i = 0; i < 8; ++i) { let id = readInt64LE(bytes, (i << 3) + 8); // imageset id [6] let imgIdx0 = bytes[(i << 3) + 14]; // image index 0 [7] let imgIdx1 = bytes[(i << 3) + 15]; // image index 1 [8] sp.push([id, imgIdx0, imgIdx1]) }