Run details:
Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.99 Safari/537.36
Chrome 93
Windows 7
Desktop
2 years ago
Test name Executions per second
Int switch 161273.8 Ops/sec
str switch 158464.6 Ops/sec
int if-else 76097.7 Ops/sec
str if-else 69924.1 Ops/sec
int object-key 166777.5 Ops/sec
str object-key 161855.7 Ops/sec
Script Preparation code:
Tests:
  • Int switch

  • str switch

  • int if-else

  • str if-else

  • int object-key

  • str object-key