Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36
Chrome 123
Windows
Desktop
8 months ago
Test name Executions per second
floor 5723614.5 Ops/sec
~~ 9751078.0 Ops/sec
>> 0 9860451.0 Ops/sec
| 0 9835473.0 Ops/sec
<< 0 9725578.0 Ops/sec
& 0xFFFFFFFFFFFF 9762512.0 Ops/sec
^ 0x000000000000 9792777.0 Ops/sec
Math.trunc() 5707920.0 Ops/sec
x - (x % 1) 6244633.5 Ops/sec
parseInt() 5686037.5 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()