Run details:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Mobile Safari/537.36
Chrome Mobile 117
Android
Mobile
one year ago
Test name Executions per second
floor 960942.4 Ops/sec
~~ 1720387.6 Ops/sec
>> 0 1723472.8 Ops/sec
| 0 1721284.1 Ops/sec
<< 0 1720416.9 Ops/sec
& 0xFFFFFFFFFFFF 1716971.6 Ops/sec
^ 0x000000000000 1721448.2 Ops/sec
Math.trunc() 977524.0 Ops/sec
x - (x % 1) 1096774.6 Ops/sec
parseInt() 962749.2 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()