Skip to content
This repository has been archived by the owner on Aug 15, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant