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

Fix performance issue when it's not on focus #12

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Fix performance issue when it's not on focus #12

wants to merge 2 commits into from

Conversation

gartz
Copy link

@gartz gartz commented Feb 12, 2018

There was a setInterval to check the notifications. The thing is that V8 will reduce the resource usage when the DOM is not on focus, but it will add the interval executions pending to a queue.

When you focus the app again, it will try to clear the queue, since the logic in that interval is "heavy" it will result in a heavy process load for quite a while.

This quick fix replace the setInterval by another in use DOM listener that already check the notifications and then uses a lightweight check to execute the notification.

I've being using this for half a day and even in development mode the performance is way better than production mode.

I really recommend the code merge. :)

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.

1 participant