Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36
Chrome 87
Linux
Desktop
3 years ago
Test name Executions per second
floor 2656282.8 Ops/sec
~~ 4875694.0 Ops/sec
>> 0 4960950.0 Ops/sec
| 0 4925718.0 Ops/sec
<< 0 4968525.0 Ops/sec
& 0xFFFFFFFFFFFF 4952039.5 Ops/sec
^ 0x000000000000 4932585.0 Ops/sec
Math.trunc() 2667409.5 Ops/sec
x - (x % 1) 3385423.0 Ops/sec
parseInt() 2623041.8 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()