default-passive-events icon indicating copy to clipboard operation
default-passive-events copied to clipboard

Question: add new types of events

Open beradrian opened this issue 5 years ago • 5 comments

Is it possible to add the passive flag by default to other events like "animationend" or "transitionend"?

beradrian avatar Mar 25 '19 12:03 beradrian

Now we are supporting only touch-or-scroll-blocking events, because that's where the problem exists. Can you elaborate about any gains with having animation/transition connected events set as passive?

FRSgit avatar Mar 26 '19 09:03 FRSgit

Most probably the same gains - performance improvements. And I think the library can be easily modified to add new events. I can even prepare a PR for this if interested.

beradrian avatar Mar 26 '19 14:03 beradrian

Actually now the most important would be to create some perf which shows any performance gain using passive approach. If you can prepare that, I'll make a change to library immediately. Is it possible for you to create such test? It might event depend on browser's built-in developer tools. Just try to make lots of animations at once, and in one case use passive event and in the other don't do it.

FRSgit avatar Mar 28 '19 09:03 FRSgit

I'll investigate that.

beradrian avatar Mar 28 '19 10:03 beradrian

I created a test with many elements all with transitions and many iterations. The results seems to be inconclusive. The difference is too low between passive and non-passive to say that there's a performance penalty for non-passive events for transitionend. The number of HTML elements and iterations can be easily configured. The results are displayed in the console as INFO messages - please disable DEBUG messages. index.zip

Is there a similar test for scroll events?

beradrian avatar May 19 '19 06:05 beradrian