Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.80 Safari/537.36
Chrome 98
Linux
Desktop
2 years ago
Test name Executions per second
floor 2937000.8 Ops/sec
~~ 5935873.5 Ops/sec
>> 0 5986695.5 Ops/sec
| 0 6012612.5 Ops/sec
<< 0 5941473.0 Ops/sec
& 0xFFFFFFFFFFFF 5979398.0 Ops/sec
^ 0x000000000000 5963863.0 Ops/sec
Math.trunc() 2954872.0 Ops/sec
x - (x % 1) 4014627.5 Ops/sec
parseInt() 2968663.2 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()