Script Preparation code:
Tests:

Historical Performance Data aggregated from 10 community runs

Desktop Results:
Chrome 10 runs
Switch
165K/s
Object Literal
159K/s
Array Literal
155K/s
View exact numbers
  • Switch: 165,153 ops/sec
  • Object Literal: 159,258 ops/sec
  • Array Literal: 155,085 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
    Object Literal
    Array Literal

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 months ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Safari/605.1.15
Safari 26 on Mac OS X 10.15.7
View result in a separate tab
Switch
2.4M/s
Object Literal
2.4M/s
Array Literal
2.3M/s
View exact numbers
Test name Executions per second
Switch 2,386,356 Ops/sec
Object Literal 2,360,011 Ops/sec
Array Literal 2,326,091 Ops/sec