Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36
Chrome 130
Mac OS X 10.15.7
Desktop
one month ago
Test name Executions per second
floor 3895547.2 Ops/sec
~~ 5574895.0 Ops/sec
>> 0 5571676.5 Ops/sec
| 0 5551071.0 Ops/sec
<< 0 5545824.0 Ops/sec
& 0xFFFFFFFFFFFF 5549246.0 Ops/sec
^ 0x000000000000 5578585.0 Ops/sec
Math.trunc() 3897926.2 Ops/sec
x - (x % 1) 3118342.5 Ops/sec
parseInt() 3909100.2 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()