Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:74.0) Gecko/20100101 Firefox/74.0
Firefox 74
Mac OS X 10.14
Desktop
4 years ago
Test name Executions per second
floor 71562296.0 Ops/sec
~~ 122757816.0 Ops/sec
>> 0 123488784.0 Ops/sec
| 0 122682264.0 Ops/sec
<< 0 122801200.0 Ops/sec
& 0xFFFFFFFFFFFF 122065232.0 Ops/sec
^ 0x000000000000 119944648.0 Ops/sec
Math.trunc() 72080368.0 Ops/sec
x - (x % 1) 14322699.0 Ops/sec
parseInt() 25140656.0 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()