HTML Preparation code:
Tests:

Historical Performance Data aggregated from 6 community runs

Desktop Results:
Chrome 6 runs
Array.from, construct new Set
18K/s
Convert JS Set to array, construct new Set
16K/s
Immutable.Set union
8K/s

Fastest: Array.from, construct new Set (2.1x faster)

View exact numbers
  • Array.from, construct new Set: 17,514 ops/sec
  • Convert JS Set to array, construct new Set: 15,970 ops/sec
  • Immutable.Set union: 8,424 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
    Immutable.Set union
    Convert JS Set to array, construct new Set
    Array.from, construct new Set

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36
Chrome 137 on Windows
View result in a separate tab
Array.from, construct new Set
14K/s
Convert JS Set to array, construct new Set
13K/s
Immutable.Set union
5K/s
View exact numbers
Test name Executions per second
Array.from, construct new Set 13,985 Ops/sec
Convert JS Set to array, construct new Set 12,857 Ops/sec
Immutable.Set union 5,330 Ops/sec