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 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36
Chrome 130 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
floor 5644090.5 Ops/sec
~~ 8023775.0 Ops/sec
>> 0 8008183.0 Ops/sec
| 0 8009496.5 Ops/sec
<< 0 8006017.5 Ops/sec
& 0xFFFFFFFFFFFF 8025707.0 Ops/sec
^ 0x000000000000 8017843.0 Ops/sec
Math.trunc() 5645136.0 Ops/sec
x - (x % 1) 4819172.5 Ops/sec
parseInt() 5674027.5 Ops/sec


;