Run details:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/110.0
Firefox 110
Ubuntu
Desktop
one year ago
Test name Executions per second
floor 128456024.0 Ops/sec
~~ 187650656.0 Ops/sec
>> 0 150660960.0 Ops/sec
| 0 136426560.0 Ops/sec
<< 0 151453232.0 Ops/sec
& 0xFFFFFFFFFFFF 150466336.0 Ops/sec
^ 0x000000000000 155025056.0 Ops/sec
Math.trunc() 151825232.0 Ops/sec
x - (x % 1) 950543168.0 Ops/sec
parseInt() 153602896.0 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()