Run details:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Mobile Safari/537.36
Chrome Mobile 116
Android
Mobile
one year ago
Test name Executions per second
floor 2402705.8 Ops/sec
~~ 4692270.5 Ops/sec
>> 0 4915958.5 Ops/sec
| 0 4965650.0 Ops/sec
<< 0 4913542.0 Ops/sec
& 0xFFFFFFFFFFFF 4915011.0 Ops/sec
^ 0x000000000000 4892335.0 Ops/sec
Math.trunc() 2490830.8 Ops/sec
x - (x % 1) 2820419.5 Ops/sec
parseInt() 2418012.5 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()