Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Chrome 131
Windows
Desktop
17 days ago
Test name Executions per second
floor 10540791.0 Ops/sec
~~ 10427872.0 Ops/sec
>> 0 10430640.0 Ops/sec
| 0 10509683.0 Ops/sec
<< 0 10454806.0 Ops/sec
& 0xFFFFFFFFFFFF 10567429.0 Ops/sec
^ 0x000000000000 10559267.0 Ops/sec
Math.trunc() 10349791.0 Ops/sec
x - (x % 1) 9902300.0 Ops/sec
parseInt() 10324364.0 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()