Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:104.0) Gecko/20100101 Firefox/104.0
Firefox 104
Linux
Desktop
2 years ago
Test name Executions per second
floor 505860448.0 Ops/sec
~~ 529583840.0 Ops/sec
>> 0 545770368.0 Ops/sec
| 0 545646656.0 Ops/sec
<< 0 540687424.0 Ops/sec
& 0xFFFFFFFFFFFF 541579648.0 Ops/sec
^ 0x000000000000 540689344.0 Ops/sec
Math.trunc() 518105632.0 Ops/sec
x - (x % 1) 540859008.0 Ops/sec
parseInt() 24414618.0 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()


;