Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.1 Safari/605.1.15
Safari 17
Mac OS X 10.15.7
Desktop
7 months ago
Test name Executions per second
floor 4881769.0 Ops/sec
~~ 4695875.5 Ops/sec
>> 0 8348405.5 Ops/sec
| 0 8363691.5 Ops/sec
<< 0 8392286.0 Ops/sec
& 0xFFFFFFFFFFFF 8395222.0 Ops/sec
^ 0x000000000000 5430023.0 Ops/sec
Math.trunc() 2353186.8 Ops/sec
x - (x % 1) 5009721.5 Ops/sec
parseInt() 4966352.0 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()


;