Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0
Firefox 108
Windows
Desktop
one year ago
Test name Executions per second
floor 289628384.0 Ops/sec
~~ 289487488.0 Ops/sec
>> 0 289693632.0 Ops/sec
| 0 288886976.0 Ops/sec
<< 0 288701920.0 Ops/sec
& 0xFFFFFFFFFFFF 289428256.0 Ops/sec
^ 0x000000000000 286959808.0 Ops/sec
Math.trunc() 288575936.0 Ops/sec
x - (x % 1) 749390976.0 Ops/sec
parseInt() 34092684.0 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()


;