Script Preparation code:
Tests:
  • Int switch

  • str switch

  • int if-else

  • str if-else

  • int object-key

  • str object-key

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    Int switch
    str switch
    int if-else
    str if-else
    int object-key
    str object-key

    Fastest: N/A

    Slowest: N/A

Get performance results from real users on your website with Request Metrics.
Latest run results:
Run details: (Test run date: one year ago)
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 on Windows 7
View result in a separate tab
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