Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 11_0_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.67 Safari/537.36 Edg/87.0.664.47
Chrome 87
Mac OS X 11.0.1
Desktop
3 years ago
Test name Executions per second
floor 3285475.0 Ops/sec
~~ 6032852.0 Ops/sec
>> 0 6032436.0 Ops/sec
| 0 6047907.0 Ops/sec
<< 0 6032501.5 Ops/sec
& 0xFFFFFFFFFFFF 6039361.5 Ops/sec
^ 0x000000000000 6030092.5 Ops/sec
Math.trunc() 3283493.5 Ops/sec
x - (x % 1) 4162351.8 Ops/sec
parseInt() 3313339.5 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()


;