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: 17 days ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.6.1 Safari/605.1.15
Safari 26 on Mac OS X 10.15.7
View result in a separate tab
switch case
829.4M/s
if/else
811.8M/s
map lookup
761.8M/s
View exact numbers
Test name Executions per second
switch case 829,427,648 Ops/sec
if/else 811,781,504 Ops/sec
map lookup 761,774,208 Ops/sec