Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/115.0
Firefox 115
Mac OS X 10.15
Desktop
one year ago
Test name Executions per second
floor 115334832.0 Ops/sec
~~ 101509832.0 Ops/sec
>> 0 87228120.0 Ops/sec
| 0 83539608.0 Ops/sec
<< 0 89627896.0 Ops/sec
& 0xFFFFFFFFFFFF 99545616.0 Ops/sec
^ 0x000000000000 107933408.0 Ops/sec
Math.trunc() 109883432.0 Ops/sec
x - (x % 1) 281267872.0 Ops/sec
parseInt() 106129024.0 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()