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 2119978.2 Ops/sec
Direct 7935275.0 Ops/sec
With BigInt 992595.2 Ops/sec
Simple Loop 7959542.0 Ops/sec
Loop No Assignment 7819007.0 Ops/sec
Loop No Assignment No Second Counter 7958039.0 Ops/sec
Loop Exit on 0 8072264.5 Ops/sec
Loop Exit on 0 single byte 8155211.0 Ops/sec
Loop Exit on 0 with 0 8246115.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