Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
Chrome 124
Windows
Desktop
8 months ago
Test name Executions per second
floor 7472093.0 Ops/sec
~~ 13009965.0 Ops/sec
>> 0 13047851.0 Ops/sec
| 0 12975317.0 Ops/sec
<< 0 12957358.0 Ops/sec
& 0xFFFFFFFFFFFF 12703684.0 Ops/sec
^ 0x000000000000 13034483.0 Ops/sec
Math.trunc() 7259132.5 Ops/sec
x - (x % 1) 8146399.5 Ops/sec
parseInt() 7544253.0 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()