Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/119.0
Firefox 119
Linux
Desktop
one year ago
Test name Executions per second
floor 233134176.0 Ops/sec
~~ 231174128.0 Ops/sec
>> 0 231305744.0 Ops/sec
| 0 230998864.0 Ops/sec
<< 0 231699568.0 Ops/sec
& 0xFFFFFFFFFFFF 231840816.0 Ops/sec
^ 0x000000000000 230799024.0 Ops/sec
Math.trunc() 233182592.0 Ops/sec
x - (x % 1) 951771392.0 Ops/sec
parseInt() 233248704.0 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()