Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36
Chrome 111
Mac OS X 10.15.7
Desktop
one year ago
Test name Executions per second
Through DataView 2155225.8 Ops/sec
Direct 7982840.5 Ops/sec
With BigInt 982669.6 Ops/sec
Simple Loop 7913821.5 Ops/sec
Loop No Assignment 7869215.5 Ops/sec
Loop No Assignment No Second Counter 7947380.5 Ops/sec
Loop Exit on 0 8076627.5 Ops/sec
Loop Exit on 0 single byte 8140286.5 Ops/sec
Loop Exit on 0 with 0 8233824.5 Ops/sec
Script Preparation code:
Tests:
  • Through DataView

  • Direct

  • With BigInt

  • Simple Loop

  • Loop No Assignment

  • Loop No Assignment No Second Counter

  • Loop Exit on 0

  • Loop Exit on 0 single byte

  • Loop Exit on 0 with 0