Run details:
Mozilla/5.0 (Linux; Android 9; Mi A1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.85 Mobile Safari/537.36
Chrome Mobile 94
Android
Mobile
3 years ago
Test name Executions per second
floor 376489.2 Ops/sec
~~ 749122.8 Ops/sec
>> 0 713973.3 Ops/sec
| 0 719476.6 Ops/sec
<< 0 725622.1 Ops/sec
& 0xFFFFFFFFFFFF 719158.6 Ops/sec
^ 0x000000000000 749279.3 Ops/sec
Math.trunc() 363821.1 Ops/sec
x - (x % 1) 431646.3 Ops/sec
parseInt() 378076.6 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()


;