Run details:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Mobile Safari/537.36
Chrome Mobile 115
Android
Mobile
one year ago
Test name Executions per second
floor 1145287.9 Ops/sec
~~ 2419702.2 Ops/sec
>> 0 2397647.5 Ops/sec
| 0 2411485.8 Ops/sec
<< 0 2422600.0 Ops/sec
& 0xFFFFFFFFFFFF 2429060.2 Ops/sec
^ 0x000000000000 2453848.8 Ops/sec
Math.trunc() 1298464.8 Ops/sec
x - (x % 1) 1491672.6 Ops/sec
parseInt() 1231503.8 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()