Skip to content

debounce and throttle seems to decrease performance for window.onscroll #48

@gregg-cbs

Description

@gregg-cbs

Hi,

Using this package I have done some tests in Firefox and I have noticed using debounce or throttle for window.onscroll function is worse then just allowing the function to run on every pixel scroll.

I wouldnt have thought this because i thought the debounce or throttle would prevent any operations from happening but it seems the operations the debounce/throttle does to debounce operations from happening is more expensive then the operations just happening.

It seems in firefox on every metric says using debounce or throttle for onscroll is worse for performance.
I guess I am putting this here for other developers and for discussion - using throttle and debounce is not always better.

Does anyone have anything to weigh in on this?
I am not a performance measuring pro.

thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions