Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36 Edg/98.0.1108.56
Chrome 98
Windows
Desktop
2 years ago
Test name Executions per second
floor 2824934.5 Ops/sec
~~ 4952593.5 Ops/sec
>> 0 4966091.0 Ops/sec
| 0 4976558.0 Ops/sec
<< 0 4970409.5 Ops/sec
& 0xFFFFFFFFFFFF 4972654.0 Ops/sec
^ 0x000000000000 4969242.5 Ops/sec
Math.trunc() 2828723.8 Ops/sec
x - (x % 1) 3388885.8 Ops/sec
parseInt() 2821031.5 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()