-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
animationFrameScheduler - Execution not syncing with requestAnimationFrame #5397
Comments
The fundamental problem is that the Evidently, there is some overhead in the scheduler implementation. AFAICT, a significant amount of this overhead is due to the bug raised in #4972 is also seen here - as you've mentioned - and I have some idea about what might causing it. However, for loops like the one in the |
Thanks for the comment. This is good info to know. |
FWIW, most (almost all?) of the overhead would have been effected by the other bug you referenced - which was fixed in 33c9c8c. But you would still be better off using |
I noticed that "double execution" bug in the Angular CDK drag-drop project in the code handling auto-scrolling during a drag. https://github.com/angular/components/blob/master/src/cdk/drag-drop/drop-list-ref.ts#L778 Looks like they are referencing RxJS 6.5.3 with that project (so can't use |
Bug Report
See this StackBlitz example, where I am testing different methods of using
animationFrameScheduler
to (hopefully) execute code on everyrequestAnimationFrame
.The following methods are as follows:
When running these all at the same time, the console log outputs of the counters after 1 second are as follows:
Why do these not all match the "real" value of 59?
Next, comment out the first method. Console output:
Why do the second, third, and fourth outputs here not "match" the above run?
Next, comment out the first, second, and third methods. Console output:
(this fourth method is a copy of the
animationFrameScheduler
example from the official docs)Why is this running almost twice as often as
requestAnimationFrame
? Probably related to #4972In general with all these "comment out" examples, why is the number of schedules running affecting these execution counts?
Environment
The text was updated successfully, but these errors were encountered: