Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.6.1 Safari/605.1.15
Safari 15
Mac OS X 10.15.7
Desktop
2 years ago
Test name Executions per second
floor 2057634.4 Ops/sec
~~ 3685239.2 Ops/sec
>> 0 3679724.0 Ops/sec
| 0 3658277.5 Ops/sec
<< 0 3691791.0 Ops/sec
& 0xFFFFFFFFFFFF 3674261.5 Ops/sec
^ 0x000000000000 3715175.5 Ops/sec
Math.trunc() 2075225.2 Ops/sec
x - (x % 1) 2487390.5 Ops/sec
parseInt() 1923595.5 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()


;