Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36
Chrome 79
Windows
Desktop
4 years ago
Test name Executions per second
unsorted array includes existing item 2340530.5 Ops/sec
sorted array includes existing item 2513957.2 Ops/sec
unsorted array includes unexisting item 2177345.8 Ops/sec
sorted array includes unexisting item 2202218.5 Ops/sec
unsorted set has existing item 2633429.2 Ops/sec
sorted set has existing item 2587157.5 Ops/sec
unsorted set has unexisting item 2647399.2 Ops/sec
sorted set has unexisting item 2519981.2 Ops/sec
Script Preparation code:
Tests:
  • unsorted array includes existing item

  • sorted array includes existing item

  • unsorted array includes unexisting item

  • sorted array includes unexisting item

  • unsorted set has existing item

  • sorted set has existing item

  • unsorted set has unexisting item

  • sorted set has unexisting item