Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/118.0
Firefox 118
Mac OS X 10.15
Desktop
one year ago
Test name Executions per second
floor 435465440.0 Ops/sec
~~ 435942528.0 Ops/sec
>> 0 436431680.0 Ops/sec
| 0 435127232.0 Ops/sec
<< 0 436292000.0 Ops/sec
& 0xFFFFFFFFFFFF 436212800.0 Ops/sec
^ 0x000000000000 436110368.0 Ops/sec
Math.trunc() 435903808.0 Ops/sec
x - (x % 1) 462465696.0 Ops/sec
parseInt() 434425376.0 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()