Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0
Firefox 111
Windows
Desktop
one year ago
Test name Executions per second
floor 241793664.0 Ops/sec
~~ 240813856.0 Ops/sec
>> 0 241487504.0 Ops/sec
| 0 241950160.0 Ops/sec
<< 0 242078800.0 Ops/sec
& 0xFFFFFFFFFFFF 241656144.0 Ops/sec
^ 0x000000000000 242044352.0 Ops/sec
Math.trunc() 242895472.0 Ops/sec
x - (x % 1) 586720000.0 Ops/sec
parseInt() 243751440.0 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()


;