HTML Preparation code:
AخA
 
1
<!--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);
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    reduce
    unify

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 3 months ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Chrome 131 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
reduce 1.7 Ops/sec
unify 1.7 Ops/sec