Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:104.0) Gecko/20100101 Firefox/104.0
Firefox 104
Windows
Desktop
2 years ago
Test name Executions per second
floor 694632448.0 Ops/sec
~~ 760053056.0 Ops/sec
>> 0 722013120.0 Ops/sec
| 0 761743744.0 Ops/sec
<< 0 753895744.0 Ops/sec
& 0xFFFFFFFFFFFF 734273536.0 Ops/sec
^ 0x000000000000 753432960.0 Ops/sec
Math.trunc() 681801024.0 Ops/sec
x - (x % 1) 941477184.0 Ops/sec
parseInt() 28658106.0 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()