Skip to content
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

queso backport: Use MessageChannel instead of setTimeout to avoid processing delays #8677

Merged
merged 2 commits into from
Aug 22, 2019

Conversation

kkaefer
Copy link
Member

@kkaefer kkaefer commented Aug 22, 2019

Backports #8673 to release-queso


Fixes #8671.

It works around the setTimeout caveats in IE (in my analysis, I found that setTimeout sometimes took more than 30 milliseconds just to execute the next call!) by switch to the universally supported MessageChannel objects. It's normally used to communicate between two different contexts, but you can also use it to "communicate" between the same context. It solves the performance regression reported in #8671 while maintaining the faster cancellation processing from #8633 by decoupling the messages sent from the counterpart from processing: it throttles the postMessage calls it receives from the sender to just one pending postMessage. This is essentially what setTimeout(..., 0) does too.

@kkaefer kkaefer requested a review from mourner August 22, 2019 16:10
@mourner mourner merged commit da7eb67 into release-queso Aug 22, 2019
@mourner mourner deleted the backport-queso-8673-messagechannel branch August 22, 2019 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants