Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36
Chrome 91
Windows
Desktop
3 years ago
Test name Executions per second
floor 2353849.0 Ops/sec
~~ 4428675.0 Ops/sec
>> 0 4616084.0 Ops/sec
| 0 4449912.5 Ops/sec
<< 0 4493550.5 Ops/sec
& 0xFFFFFFFFFFFF 4630880.0 Ops/sec
^ 0x000000000000 4552198.0 Ops/sec
Math.trunc() 2386474.2 Ops/sec
x - (x % 1) 2925399.0 Ops/sec
parseInt() 2442619.2 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()


;