Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36
Chrome 68
Mac OS X 10.13.6
Desktop
6 years ago
Test name Executions per second
floor 2781481.2 Ops/sec
~~ 5836322.0 Ops/sec
>> 0 5829568.0 Ops/sec
| 0 5832578.0 Ops/sec
<< 0 5900570.0 Ops/sec
& 0xFFFFFFFFFFFF 5858195.5 Ops/sec
^ 0x000000000000 5833935.5 Ops/sec
Math.trunc() 2756618.5 Ops/sec
x - (x % 1) 3973631.2 Ops/sec
parseInt() 2811660.5 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()


;