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 244867744.0 Ops/sec
~~ 240360384.0 Ops/sec
>> 0 241248240.0 Ops/sec
| 0 241863328.0 Ops/sec
<< 0 243597424.0 Ops/sec
& 0xFFFFFFFFFFFF 244755760.0 Ops/sec
^ 0x000000000000 241664928.0 Ops/sec
Math.trunc() 229432080.0 Ops/sec
x - (x % 1) 353175552.0 Ops/sec
parseInt() 218414896.0 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()


;