Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
unique_array_reduce
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Browser:
Chrome 131
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
reduce
2.2 Ops/sec
unify
2.3 Ops/sec
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
let groups = []; for (let i = 0, lengthI = 10000; i < lengthI; ++i) { const group = []; for (let j = 0, lengthJ = 10000; j < lengthJ; ++j) { group.push(j % 2 ? 'a' : 'b'); } groups.push(group); }
Tests:
reduce
Array.from(groups.reduce((set, group) => { group.forEach(value => set.add(value)); return set; }, new Set()));
unify
const mySet = new Set(); groups.forEach(group => group.forEach(value => mySet.add(value))); return Array.from(mySet);