Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36
Chrome 112
Mac OS X 10.15.7
Desktop
one year ago
Test name Executions per second
floor 4018069.8 Ops/sec
~~ 7385247.0 Ops/sec
>> 0 7465122.5 Ops/sec
| 0 7421845.0 Ops/sec
<< 0 7468713.0 Ops/sec
& 0xFFFFFFFFFFFF 7472268.5 Ops/sec
^ 0x000000000000 7434231.0 Ops/sec
Math.trunc() 4027435.2 Ops/sec
x - (x % 1) 4942234.5 Ops/sec
parseInt() 3967567.5 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()


;