Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:129.0) Gecko/20100101 Firefox/129.0
Firefox 129
Linux
Desktop
3 months ago
Test name Executions per second
floor 250410400.0 Ops/sec
~~ 251068528.0 Ops/sec
>> 0 251383872.0 Ops/sec
| 0 251538832.0 Ops/sec
<< 0 251872752.0 Ops/sec
& 0xFFFFFFFFFFFF 251950336.0 Ops/sec
^ 0x000000000000 251857360.0 Ops/sec
Math.trunc() 246752496.0 Ops/sec
x - (x % 1) 1285454720.0 Ops/sec
parseInt() 248836608.0 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()