Run details:
Mozilla/5.0 (Linux; Android 10; ART-L29N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.105 Mobile Safari/537.36 OPR/63.3.3216.58675
Opera Mobile 63
Android
Mobile
3 years ago
Test name Executions per second
floor 765288.6 Ops/sec
~~ 1513976.9 Ops/sec
>> 0 1512011.2 Ops/sec
| 0 1514970.1 Ops/sec
<< 0 1517091.2 Ops/sec
& 0xFFFFFFFFFFFF 1515368.1 Ops/sec
^ 0x000000000000 1515935.0 Ops/sec
Math.trunc() 771086.8 Ops/sec
x - (x % 1) 912101.4 Ops/sec
parseInt() 800972.6 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()


;