-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Is it possible to disable throttling of worker / broadcast channel messages? #7090
Comments
Will look to enable this feature. Thanks. |
This is fixed in git and will be available in the next nightly build. |
This change is released with 0.43.5. |
@rogerwang this issue is back on v0.44.3 (tested on windows 10). |
I don't see this issue on macOS Catalina with 0.43.5 or 0.44.3, but it can be reproduced on Windows 7 and Ubuntu 16.04 with either of versions, so it seems it has not been fixed for Windows and Linux. |
This is fixed in git and will be available in the next nightly build. Please use |
It seems that after app is hidden / minimized for about 10 seconds the delivery of messages that are sent to workers via Worker.postMessage or BroadcastChannel.postMessage gets throttled and executed once per second, adding substantial delays to app logic in cases when there are multiple interactions between main and worker threads.
Is there a way to disable this throttling?
On top of that, it seems that
--disable-background-timer-throttling
is being ignored for setTimeout in the worker threads. So, once app is in background for 10 seconds execution of operations scheduled with setTimeout get throttled as well, even though it's not throttled on the main thread once that option is added.Is this expected behavior for setTimeout in worker threads?
Throttling / timing is slightly different depending on release, but it's present in several latest major releases.
Here is code to replicate the issue:
main.js
:worker.js
:So, while app is in foreground we don't have delays in delivery of messages or above of what we request with setTimeout:
After about 10 seconds when app is minimized or moved to another desktop we start experiencing delivery delay for message that is sent from main thread to a worker thread as well and delay for execution of operations via setTimeout:
Once application is restored / focused on the timing gets back to normal:
It does not seem that this happens if app just blurs, but stays on current desktop in background, so one has to either minimize or move it to another desktop to reproduce.
In attached zip I included
index.html
,worker.js
andpackage.json
(with--disable-background-timer-throttling
set inchromium-args
, can be executed viayarn install && yarn start
).background-throttling.zip
The text was updated successfully, but these errors were encountered: