Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36
Chrome 100
Windows
Desktop
3 years ago
Test name Executions per second
++i, division and multiplication 10548.7 Ops/sec
++i and bit shift 10729.3 Ops/sec
i += 2 10966.3 Ops/sec
++i, ++i 10628.6 Ops/sec
++i, [++i] 10966.3 Ops/sec
[++i], [++i] 10916.4 Ops/sec
[i++], [i++] 10755.8 Ops/sec
Script Preparation code:
Tests:
  • ++i, division and multiplication

  • ++i and bit shift

  • i += 2

  • ++i, ++i

  • ++i, [++i]

  • [++i], [++i]

  • [i++], [i++]