Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/117.0
Firefox 117
Mac OS X 10.15
Desktop
one year ago
Test name Executions per second
floor 241124480.0 Ops/sec
~~ 239937856.0 Ops/sec
>> 0 241109504.0 Ops/sec
| 0 241507168.0 Ops/sec
<< 0 241722320.0 Ops/sec
& 0xFFFFFFFFFFFF 241697312.0 Ops/sec
^ 0x000000000000 240299264.0 Ops/sec
Math.trunc() 241642240.0 Ops/sec
x - (x % 1) 390181600.0 Ops/sec
parseInt() 240962592.0 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()