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: yesterday)
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Chrome 131 on Linux
View result in a separate tab
Test name Executions per second
floor 3095590.2 Ops/sec
~~ 4453608.5 Ops/sec
>> 0 4503583.5 Ops/sec
| 0 4412662.0 Ops/sec
<< 0 3966522.0 Ops/sec
& 0xFFFFFFFFFFFF 3823300.0 Ops/sec
^ 0x000000000000 3770647.2 Ops/sec
Math.trunc() 2746183.8 Ops/sec
x - (x % 1) 2601081.8 Ops/sec
parseInt() 2704245.8 Ops/sec


;