Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Firefox 89
Windows
Desktop
3 years ago
Test name Executions per second
floor 449104704.0 Ops/sec
~~ 518906304.0 Ops/sec
>> 0 625136512.0 Ops/sec
| 0 714924608.0 Ops/sec
<< 0 834523008.0 Ops/sec
& 0xFFFFFFFFFFFF 837697984.0 Ops/sec
^ 0x000000000000 981028288.0 Ops/sec
Math.trunc() 817906496.0 Ops/sec
x - (x % 1) 718681024.0 Ops/sec
parseInt() 27357992.0 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()


;