Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:132.0) Gecko/20100101 Firefox/132.0
Firefox 132
Linux
Desktop
one month ago
Test name Executions per second
floor 575117376.0 Ops/sec
~~ 580770432.0 Ops/sec
>> 0 578717120.0 Ops/sec
| 0 576943424.0 Ops/sec
<< 0 582982656.0 Ops/sec
& 0xFFFFFFFFFFFF 580091072.0 Ops/sec
^ 0x000000000000 580917376.0 Ops/sec
Math.trunc() 580324160.0 Ops/sec
x - (x % 1) 580449664.0 Ops/sec
parseInt() 582229504.0 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()