Script Preparation code:
Tests:

Historical Performance Data aggregated from 137 community runs

Desktop Results:
Chrome 100 runs
Switch
297K/s
Object Literal
269K/s

Fastest: Switch (1.1x faster)

View exact numbers
  • Switch: 296,813 ops/sec
  • Object Literal: 269,491 ops/sec
Safari 13 runs
Switch
1.3M/s
Object Literal
1.2M/s
View exact numbers
  • Switch: 1,288,758 ops/sec
  • Object Literal: 1,219,413 ops/sec
Firefox 11 runs
Switch
175K/s
Object Literal
160K/s
View exact numbers
  • Switch: 175,032 ops/sec
  • Object Literal: 160,456 ops/sec
Mobile Results:
Chrome 13 runs
Switch
161K/s
Object Literal
105K/s

Fastest: Switch (1.5x faster)

View exact numbers
  • Switch: 161,038 ops/sec
  • Object Literal: 104,608 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

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 4 months ago)
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36
Chrome 146 on Linux
View result in a separate tab
Switch
443K/s
Object Literal
385K/s
View exact numbers
Test name Executions per second
Switch 442,791 Ops/sec
Object Literal 385,481 Ops/sec