Run details:
Mozilla/5.0 (Linux; Android 6.0.1; SAMSUNG SM-T805 Build/MMB29K) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/6.4 Chrome/56.0.2924.87 Safari/537.36
Chrome 56
Android 6.0.1
Samsung SM-T805
6 years ago
Test name Executions per second
For loop, basic 34.3 Ops/sec
While loop, basic 33.9 Ops/sec
For loop, cached (inside for statement) 45.5 Ops/sec
For loop, cached (outside for statement) 45.6 Ops/sec
For loop, i-- (caching inside for loop) 43.8 Ops/sec
For loop, i-- (caching outside for loop) 39.0 Ops/sec
While loop, cached 44.1 Ops/sec
While loop, i-- 46.4 Ops/sec
forEach 51.7 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


;