Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36
Chrome 80
Windows
Desktop
4 years ago
Test name Executions per second
floor 2540978.5 Ops/sec
~~ 4569426.0 Ops/sec
>> 0 4529384.5 Ops/sec
| 0 4534632.0 Ops/sec
<< 0 4562570.0 Ops/sec
& 0xFFFFFFFFFFFF 4555526.5 Ops/sec
^ 0x000000000000 4562978.0 Ops/sec
Math.trunc() 2490025.0 Ops/sec
x - (x % 1) 3035821.5 Ops/sec
parseInt() 2558857.2 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()


;