Script Preparation code:
Tests:

Historical Performance Data aggregated from 7 community runs

Desktop Results:
Chrome 7 runs
if/else
2K/s
JSON
2K/s
switch/case
2K/s
View exact numbers
  • if/else: 1,641 ops/sec
  • JSON: 1,617 ops/sec
  • switch/case: 1,609 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
    if/else
    switch/case
    JSON

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 10 months ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:145.0) Gecko/20100101 Firefox/145.0
Firefox 145 on Windows
View result in a separate tab
switch/case
4K/s
JSON
4K/s
if/else
4K/s
View exact numbers
Test name Executions per second
switch/case 3,802 Ops/sec
JSON 3,719 Ops/sec
if/else 3,702 Ops/sec