Demo:
If your page's scrolling event being fired too many times,
you're likely to see scrolling performance issue (jank) occurs in your page!

Scroll time: 0

This demo intended to show you, if you attach a scroll handler to an element, and scroll that element down say 1000px, you're likely to see 100+ events be fired.

To see the result, please check the right bottom scroll counter while you scrolling the page.

Whenever you scroll a page the browser will need to go through a tedious process:- calculation, rendering, painting & compositing.

If your event handler does a bunch of work (like heavy calculations and other DOM manipulation), you may see performance issues (jank).

To improve the scrolling performance, you have to limit down the rate of scroll event being fired.