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

Latest run results:
Run details: (Test run date: 2 days ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0
Chrome 134 on Windows
View result in a separate tab
Test name Executions per second
floor 9781432.0 Ops/sec
~~ 9938128.0 Ops/sec
>> 0 9802965.0 Ops/sec
| 0 9892869.0 Ops/sec
<< 0 9964213.0 Ops/sec
& 0xFFFFFFFFFFFF 9484497.0 Ops/sec
^ 0x000000000000 9776536.0 Ops/sec
Math.trunc() 9704145.0 Ops/sec
x - (x % 1) 9746644.0 Ops/sec
parseInt() 9214333.0 Ops/sec