Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36
Chrome 87
Linux
Desktop
3 years ago
Test name Executions per second
floor 1924967.5 Ops/sec
~~ 3473244.0 Ops/sec
>> 0 3312575.2 Ops/sec
| 0 3527468.0 Ops/sec
<< 0 3504500.5 Ops/sec
& 0xFFFFFFFFFFFF 3551019.5 Ops/sec
^ 0x000000000000 3644182.2 Ops/sec
Math.trunc() 1898795.4 Ops/sec
x - (x % 1) 2344458.0 Ops/sec
parseInt() 1906672.4 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()


;