Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    floor
    ~~
    >> 0
    | 0
    << 0
    & 0xFFFFFFFFFFFF
    ^ 0x000000000000
    Math.trunc()
    x - (x % 1)
    parseInt()

    Fastest: N/A

    Slowest: N/A

Get performance results from real users on your website with Request Metrics.
Latest run results:
Run details: (Test run date: 15 days ago)
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 on Windows
View result in a separate tab
Test name Executions per second
floor 7472093.0 Ops/sec
~~ 13009970.0 Ops/sec
>> 0 13047850.0 Ops/sec
| 0 12975320.0 Ops/sec
<< 0 12957360.0 Ops/sec
& 0xFFFFFFFFFFFF 12703680.0 Ops/sec
^ 0x000000000000 13034480.0 Ops/sec
Math.trunc() 7259133.0 Ops/sec
x - (x % 1) 8146400.0 Ops/sec
parseInt() 7544253.0 Ops/sec