Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36
Chrome 122
Windows
Desktop
8 months ago
Test name Executions per second
floor 7554832.0 Ops/sec
~~ 13317465.0 Ops/sec
>> 0 13406114.0 Ops/sec
| 0 13310665.0 Ops/sec
<< 0 13438995.0 Ops/sec
& 0xFFFFFFFFFFFF 12695292.0 Ops/sec
^ 0x000000000000 13376848.0 Ops/sec
Math.trunc() 7603366.5 Ops/sec
x - (x % 1) 8621227.0 Ops/sec
parseInt() 7554266.0 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()


;