Run details:
Mozilla/5.0 (Linux; Android 8.1.0; Nexus 6P Build/OPM3.171019.013) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.123 Mobile Safari/537.36
Chrome Mobile 64
Android 8.1.0
Nexus 6P
2025 years ago
Test name Executions per second
For loop, basic 64.8 Ops/sec
While loop, basic 67.4 Ops/sec
For loop, cached (inside for statement) 86.0 Ops/sec
For loop, cached (outside for statement) 89.8 Ops/sec
For loop, i-- (caching inside for loop) 91.8 Ops/sec
For loop, i-- (caching outside for loop) 89.9 Ops/sec
While loop, cached 112.0 Ops/sec
While loop, i-- 105.7 Ops/sec
forEach 147.2 Ops/sec
Script Preparation code:
Tests:
  • For loop, basic

  • While loop, basic

  • For loop, cached (inside for statement)

  • For loop, cached (outside for statement)

  • For loop, i-- (caching inside for loop)

  • For loop, i-- (caching outside for loop)

  • While loop, cached

  • While loop, i--

  • forEach


;