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

process.nextTick polyfill is slow when tab is unfocused #92

Open
satazor opened this issue Jun 14, 2019 · 0 comments
Open

process.nextTick polyfill is slow when tab is unfocused #92

satazor opened this issue Jun 14, 2019 · 0 comments

Comments

@satazor
Copy link

satazor commented Jun 14, 2019

The nextTick polyfill is supplied by https://github.com/defunctzombie/node-process/blob/master/browser.js which uses timers. See: defunctzombie/node-process#86.

Because timers are often throttled when a tab is not active to improve battery life, they only run at 1Hz (once every second). This has a drastic performance impact in those scenarios.

It seems that the author won't change this for the time being, see: webtorrent/webtorrent#1568 (comment)

It would be cool to just map nextTick to setImmediate, as we are already providing that polyfill.

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

No branches or pull requests

1 participant