Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36 Edg/116.0.1938.62
Chrome 116
Windows
Desktop
one year ago
Test name Executions per second
Array - iteration 45313.0 Ops/sec
Set - iteration 19083.8 Ops/sec
Array - includes 1375951.8 Ops/sec
Set - has 10655326.0 Ops/sec
Array - push 6141996.0 Ops/sec
Set - add 10119251.0 Ops/sec
Array - deletion 64.6 Ops/sec
Set - deletion 9614678.0 Ops/sec
Converting a Set to an Array 7128.0 Ops/sec
Script Preparation code:
Tests:
  • Array - iteration

  • Set - iteration

  • Array - includes

  • Set - has

  • Array - push

  • Set - add

  • Array - deletion

  • Set - deletion

  • Converting a Set to an Array