Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36
Chrome 109
Linux
Desktop
one year ago
Test name Executions per second
floor 5416975.0 Ops/sec
~~ 10649543.0 Ops/sec
>> 0 10654212.0 Ops/sec
| 0 10859454.0 Ops/sec
<< 0 11008386.0 Ops/sec
& 0xFFFFFFFFFFFF 10539160.0 Ops/sec
^ 0x000000000000 10741672.0 Ops/sec
Math.trunc() 5401729.5 Ops/sec
x - (x % 1) 6922711.0 Ops/sec
parseInt() 5732480.5 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()