Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36
Chrome 76
Windows
Desktop
5 years ago
Test name Executions per second
For loop, basic 3264.0 Ops/sec
While loop, basic 3147.3 Ops/sec
For loop, cached (inside for statement) 5092.2 Ops/sec
For loop, cached (outside for statement) 5373.7 Ops/sec
For loop, i-- (caching inside for loop) 5192.6 Ops/sec
For loop, i-- (caching outside for loop) 5287.7 Ops/sec
While loop, cached 5155.0 Ops/sec
While loop, i-- 5408.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--


;