Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36
Chrome 89
Mac OS X 10.15.7
Desktop
3 years ago
Test name Executions per second
floor 3293631.5 Ops/sec
~~ 5984225.5 Ops/sec
>> 0 6059007.0 Ops/sec
| 0 6060491.5 Ops/sec
<< 0 6025886.0 Ops/sec
& 0xFFFFFFFFFFFF 6043600.5 Ops/sec
^ 0x000000000000 6088135.5 Ops/sec
Math.trunc() 3283346.0 Ops/sec
x - (x % 1) 4131906.2 Ops/sec
parseInt() 3265681.0 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()


;