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: 5 days ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Chrome 131 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
floor 12861633.0 Ops/sec
~~ 13080450.0 Ops/sec
>> 0 13098640.0 Ops/sec
| 0 13050030.0 Ops/sec
<< 0 13111414.0 Ops/sec
& 0xFFFFFFFFFFFF 13161967.0 Ops/sec
^ 0x000000000000 13153138.0 Ops/sec
Math.trunc() 12724145.0 Ops/sec
x - (x % 1) 8114593.0 Ops/sec
parseInt() 12779675.0 Ops/sec