Script Preparation code:
Tests:
  • if loop

  • while + switch/case loop

  • function + switch/case loop

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    if loop
    while + switch/case loop
    function + switch/case loop

    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; rv:101.0) Gecko/20100101 Firefox/101.0
Firefox 101 on Windows 7
View result in a separate tab
Test name Executions per second
if loop 9181.6 Ops/sec
while + switch/case loop 9104.1 Ops/sec
function + switch/case loop 8816.0 Ops/sec