HTML Preparation code:
Script Preparation code:
Tests:

Historical Performance Data aggregated from 12 community runs

Desktop Results:
Chrome 12 runs
switch
30.8M/s
if
4.2M/s

Fastest: switch (7.3x faster)

View exact numbers
  • switch: 30,801,336 ops/sec
  • if: 4,195,234 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
    switch
    if

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 4 months ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:149.0) Gecko/20100101 Firefox/149.0
Firefox 149 on Windows
View result in a separate tab
switch
790.4M/s
if
112.6M/s
View exact numbers
Test name Executions per second
switch 790,432,512 Ops/sec
if 112,640,912 Ops/sec