Run details:
Mozilla/5.0 (Linux; Android 11) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.78 Mobile Safari/537.36
Chrome Mobile 102
Android
Mobile
2 years ago
Test name Executions per second
floor 1615786.2 Ops/sec
~~ 3032995.2 Ops/sec
>> 0 2991279.5 Ops/sec
| 0 2992571.2 Ops/sec
<< 0 2998438.5 Ops/sec
& 0xFFFFFFFFFFFF 3002477.5 Ops/sec
^ 0x000000000000 2999525.5 Ops/sec
Math.trunc() 1595751.5 Ops/sec
x - (x % 1) 1884458.1 Ops/sec
parseInt() 1592968.8 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()