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: 5 days ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.1 Safari/605.1.15
Safari 17 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
floor 4905662.0 Ops/sec
~~ 8346382.0 Ops/sec
>> 0 8360852.0 Ops/sec
| 0 8340542.0 Ops/sec
<< 0 8356959.0 Ops/sec
& 0xFFFFFFFFFFFF 8339355.0 Ops/sec
^ 0x000000000000 8361745.0 Ops/sec
Math.trunc() 4999561.0 Ops/sec
x - (x % 1) 4355253.0 Ops/sec
parseInt() 4917729.0 Ops/sec