Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Bitwise Big array comparision 2
Bitwise big array comparision. Goal of this test is to figure out wether it's more efficient to find 1 out of many checksums as string or integer.
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:129.0) Gecko/20100101 Firefox/129.0
Browser:
Firefox 129
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
1 or 0 out of 10 million 32 byte arrays
3.4 Ops/sec
1 or 0 out of 10 million 96 byte arrays
1.3 Ops/sec
1 or 0 out of 10 million 160byte arrays
0.8 Ops/sec
Script Preparation code:
var r32arr = new Uint8Array(32).map(() => Math.floor(Math.random() * 256)); var mil32arr = Array.from({ length: 10_000_000 }, () => new Uint8Array(32).map(() => Math.floor(Math.random() * 256))); var r96arr = new Uint8Array(96).map(() => Math.floor(Math.random() * 256)); var mil96arr = Array.from({ length: 10_000_000 }, () => new Uint8Array(96).map(() => Math.floor(Math.random() * 256))); var r160arr = new Uint8Array(160).map(() => Math.floor(Math.random() * 256)); var mil160arr = Array.from({ length: 10_000_000 }, () => new Uint8Array(160).map(() => Math.floor(Math.random() * 256)));
Tests:
1 or 0 out of 10 million 32 byte arrays
const b = mil32arr.some(arr => arr.every((value, index) => value === r32arr[index]));
1 or 0 out of 10 million 96 byte arrays
const b = mil96arr.some(arr => arr.every((value, index) => value === r96arr[index]));
1 or 0 out of 10 million 160byte arrays
const b = mil160arr.some(arr => arr.every((value, index) => value === r160arr[index]));