Script Preparation code:
Tests:

Historical Performance Data aggregated from 17 community runs

Desktop Results:
Chrome 17 runs
map lookup
98.1M/s
switch case
93.7M/s
if/else
91.9M/s
View exact numbers
  • map lookup: 98,062,280 ops/sec
  • switch case: 93,721,072 ops/sec
  • if/else: 91,945,496 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
    map lookup
    switch case
    if/else

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one month ago)
Mozilla/5.0 (X11; Linux x86_64; rv:151.0) Gecko/20100101 Firefox/151.0
Firefox 151 on Linux
View result in a separate tab
map lookup
55.8M/s
switch case
46.9M/s
if/else
12.9M/s
View exact numbers
Test name Executions per second
map lookup 55,824,296 Ops/sec
switch case 46,891,684 Ops/sec
if/else 12,894,690 Ops/sec