Run details:
Mozilla/5.0 (iPhone; CPU iPhone OS 18_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.2 Mobile/15E148 Safari/604.1
Mobile Safari 18
iOS 18.2
Mobile
one month ago
Test name Executions per second
Int switch 584695.8 Ops/sec
str switch 527985.6 Ops/sec
int if-else 222489.5 Ops/sec
str if-else 185360.0 Ops/sec
int object-key 526102.8 Ops/sec
str object-key 355381.2 Ops/sec
Script Preparation code:
Tests:
  • Int switch

  • str switch

  • int if-else

  • str if-else

  • int object-key

  • str object-key