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 (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
10 byte
1202030.8 Ops/sec
8 byte
1198582.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:
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]) }