Run details:
Mozilla/5.0 (Linux; Android 11; Pixel 3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.110 Mobile Safari/537.36
Chrome Mobile 86
Android
Mobile
4 years ago
Test name Executions per second
floor 1490292.2 Ops/sec
~~ 2975393.2 Ops/sec
>> 0 3025145.5 Ops/sec
| 0 3094469.5 Ops/sec
<< 0 3087620.8 Ops/sec
& 0xFFFFFFFFFFFF 3010141.5 Ops/sec
^ 0x000000000000 3073462.2 Ops/sec
Math.trunc() 1521206.1 Ops/sec
x - (x % 1) 1792860.6 Ops/sec
parseInt() 1543018.6 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()


;