-
Notifications
You must be signed in to change notification settings - Fork 21
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
Performance impact on continuous setTimeout? #55
Comments
@ryanmclaughlin In PR #68, it's been changed to 250ms now (240 times a minute) ... but that's not all that much better. Plus, the longer the timeout, the longer it takes to see visual changes made by the extension. So it would mean more obvious flashes when things change, like applying classes, bundling, reminders, etc. At some point in the near future, I want to refactor some of the code, especially so that core
|
I did a couple quick tests on the upcoming bundles branch, with Chrome's built-in Task Manager open to the side. For both tests, I had the tab focused, in my inbox folder, not moving the mouse. I waited for the initial loading and network spike to subside. This is on a Mid-2015 Retina MacBook Pro. So, not too bad, but hopefully that Gmail.js lib could bring it down even further. |
@russelldc Nice work. Good to see it's not terrible but definitely not great. gmail.js and Inboxsdk have the same problem I believe, their handlers have a hard time observing a change that Gmail makes to the DOM after 10s or so after loading. I've tested both libraries including manually adding an observer to watch for changes to the inbox emails list by adding a class on each email, but Gmail still somehow rerenders the inbox 10s after load and other times as well and removes everything that was changed. Hope someone can figure this out. |
@ryanmclaughlin Agh, that's disturbing... If you saw what you think you saw (ie. it wasn't just that you were using it wrong), then it might have something to do with the recent changes to Chrome over the past year or so, when they started throttling unfocused tabs/windows. Wait, actually, you didn't specifically mention the problem coming up when it was in the background. You're saying you can sit there and watch the page, and 10 seconds later, those libraries' observers stop working? |
Yeah, actively watching the dom. It's why there's a setTimeout on updateReminders currently. If you try adding a class when the page loads to an email, any changes are reverted. For example: try just running |
Just wondering, which events were you observing with Gmail.js? I still haven't tried it out myself, yet. To solve the issue you're talking about it seems you'd need to look at the following events, with
|
I can't remember to be honest. I think it was |
I'm curious what the impact is of constantly running
updateReminders
600 times a minute versus observing changes in the DOM? Any thoughts?The text was updated successfully, but these errors were encountered: