Run details:
Mozilla/5.0 (Linux; Android 11; SM-G9980) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.62 Mobile Safari/537.36
Chrome Mobile 93
Android
Mobile
3 years ago
Test name Executions per second
floor 2864785.2 Ops/sec
~~ 4972402.5 Ops/sec
>> 0 4971568.5 Ops/sec
| 0 4951915.0 Ops/sec
<< 0 4709101.5 Ops/sec
& 0xFFFFFFFFFFFF 3750942.8 Ops/sec
^ 0x000000000000 3742699.2 Ops/sec
Math.trunc() 2147160.0 Ops/sec
x - (x % 1) 2290638.0 Ops/sec
parseInt() 2164076.5 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()


;