Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36
Chrome 129
Linux
Desktop
one month ago
Test name Executions per second
Switch 4847.4 Ops/sec
Object Literal 4839.9 Ops/sec
If Else 4924.3 Ops/sec
Object Literal defined outside function 4446.1 Ops/sec
Map 2930.0 Ops/sec
Map - defined outsid function 4491.8 Ops/sec
If - just for Jason ;P 4658.7 Ops/sec
Script Preparation code:
Tests:
  • Switch

  • Object Literal

  • If Else

  • Object Literal defined outside function

  • Map

  • Map - defined outsid function

  • If - just for Jason ;P