Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36
Chrome 91
Linux
Desktop
3 years ago
Test name Executions per second
Int switch 263144.4 Ops/sec
str switch 254676.8 Ops/sec
int if-else 130750.1 Ops/sec
str if-else 120955.7 Ops/sec
int object-key 280691.1 Ops/sec
str object-key 279587.1 Ops/sec
Script Preparation code:
Tests:
  • Int switch

  • str switch

  • int if-else

  • str if-else

  • int object-key

  • str object-key


;