Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36
Chrome 130
Mac OS X 10.15.7
Desktop
one month ago
Test name Executions per second
floor 3897586.0 Ops/sec
~~ 5537676.0 Ops/sec
>> 0 5577916.5 Ops/sec
| 0 5542738.0 Ops/sec
<< 0 5581022.0 Ops/sec
& 0xFFFFFFFFFFFF 5569849.0 Ops/sec
^ 0x000000000000 5570635.0 Ops/sec
Math.trunc() 3892535.8 Ops/sec
x - (x % 1) 3190822.8 Ops/sec
parseInt() 3890451.8 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()