Run details:
Mozilla/5.0 (Linux; Android 11) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.101 Mobile Safari/537.36
Chrome Mobile 91
Android
Mobile
3 years ago
Test name Executions per second
floor 2677712.5 Ops/sec
~~ 4975091.0 Ops/sec
>> 0 4955511.5 Ops/sec
| 0 4987448.5 Ops/sec
<< 0 5004487.5 Ops/sec
& 0xFFFFFFFFFFFF 4987117.0 Ops/sec
^ 0x000000000000 5003878.0 Ops/sec
Math.trunc() 2683732.5 Ops/sec
x - (x % 1) 3017400.8 Ops/sec
parseInt() 2710757.2 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()