Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:121.0) Gecko/20100101 Firefox/121.0
Firefox 121
Linux
Desktop
one year ago
Test name Executions per second
floor 278857600.0 Ops/sec
~~ 282377376.0 Ops/sec
>> 0 284812992.0 Ops/sec
| 0 285354112.0 Ops/sec
<< 0 286665184.0 Ops/sec
& 0xFFFFFFFFFFFF 286728576.0 Ops/sec
^ 0x000000000000 284029408.0 Ops/sec
Math.trunc() 283194336.0 Ops/sec
x - (x % 1) 498382848.0 Ops/sec
parseInt() 285010624.0 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()