Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/119.0
Firefox 119
Linux
Desktop
one year ago
Test name Executions per second
switch 3686571.8 Ops/sec
if/else 4135592.5 Ops/sec
lookup 3103443.0 Ops/sec
pre-cached lookup 21770912.0 Ops/sec
Script Preparation code:
Tests:
  • switch

  • if/else

  • lookup

  • pre-cached lookup