Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36
Chrome 114
Windows
Desktop
one year ago
Test name Executions per second
floor 2636180.8 Ops/sec
~~ 4591961.5 Ops/sec
>> 0 4582193.0 Ops/sec
| 0 4570969.5 Ops/sec
<< 0 4586510.5 Ops/sec
& 0xFFFFFFFFFFFF 4597731.0 Ops/sec
^ 0x000000000000 4583989.5 Ops/sec
Math.trunc() 2637195.8 Ops/sec
x - (x % 1) 3044912.8 Ops/sec
parseInt() 2613398.8 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()