Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36
Chrome 114
Windows
Desktop
one year ago
Test name Executions per second
Switch 242562.2 Ops/sec
Object Literal 235967.8 Ops/sec
If Else 220716.8 Ops/sec
Object Literal defined outside function 213921.0 Ops/sec
Map 181703.4 Ops/sec
Map - defined outsid function 171059.6 Ops/sec
Script Preparation code:
Tests:
  • Switch

  • Object Literal

  • If Else

  • Object Literal defined outside function

  • Map

  • Map - defined outsid function


;