Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36
Chrome 75
Mac OS X 10.14.5
Desktop
5 years ago
Test name Executions per second
Standard For loop i++ 8.4 Ops/sec
Standard For loop i-- 8.0 Ops/sec
While, i-- 8.0 Ops/sec
While, with 8 iterations, with function call 66.3 Ops/sec
While, with 8 iterations, without function call 129.8 Ops/sec
While, with 50 iterations, with function call 391.2 Ops/sec
Script Preparation code:
Tests:
  • Standard For loop i++

  • Standard For loop i--

  • While, i--

  • While, with 8 iterations, with function call

  • While, with 8 iterations, without function call

  • While, with 50 iterations, with function call


;