Run details:
Mozilla/5.0 (Linux; Android 10) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36
Chrome 110
Android
Desktop
one year ago
Test name Executions per second
floor 419206.7 Ops/sec
~~ 780581.7 Ops/sec
>> 0 779869.9 Ops/sec
| 0 794760.2 Ops/sec
<< 0 785091.8 Ops/sec
& 0xFFFFFFFFFFFF 778735.1 Ops/sec
^ 0x000000000000 792815.9 Ops/sec
Math.trunc() 412901.4 Ops/sec
x - (x % 1) 485067.4 Ops/sec
parseInt() 422472.5 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()


;