Run details:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Mobile Safari/537.36
Chrome Mobile 132
Android
Mobile
2 months ago
Test name Executions per second
Switch 80274.1 Ops/sec
Object Literal 80540.7 Ops/sec
If Else 80156.7 Ops/sec
Object Literal defined outside function 78018.8 Ops/sec
Map 69331.8 Ops/sec
Map - defined outsid function 68397.4 Ops/sec
Script Preparation code:
Tests:
  • Switch

  • Object Literal

  • If Else

  • Object Literal defined outside function

  • Map

  • Map - defined outsid function