HTML Preparation code:
Script Preparation code:
Tests:

Historical Performance Data aggregated from 50 community runs

Desktop Results:
Chrome 41 runs
Set()
6.0M/s
Set() convert back to array
4.2M/s
_.union
3.9M/s

Fastest: Set() (1.5x faster)

View exact numbers
  • Set(): 5,982,972 ops/sec
  • Set() convert back to array: 4,209,372 ops/sec
  • _.union: 3,921,848 ops/sec
Firefox 9 runs
_.union
4.2M/s
Set()
2.9M/s
Set() convert back to array
2.1M/s

Fastest: _.union (2.0x faster)

View exact numbers
  • _.union: 4,158,813 ops/sec
  • Set(): 2,940,596 ops/sec
  • Set() convert back to array: 2,051,553 ops/sec

Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    _.union
    Set()
    Set() convert back to array

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 11 months ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0.1 Safari/605.1.15
Safari 26 on Mac OS X 10.15.7
View result in a separate tab
Set()
13.0M/s
Set() convert back to array
8.6M/s
_.union
8.5M/s
View exact numbers
Test name Executions per second
Set() 12,974,650 Ops/sec
Set() convert back to array 8,639,212 Ops/sec
_.union 8,511,797 Ops/sec