Closed jarylc closed 3 years ago
I can confirm I'm seeing similar spikes, and it's causing up to 5 minutes of page load delay for me at times. Restarting firefox can fix it for a while but things slow down again. I'm not sure if the slowdown is time or activity based, but it seems bad if I've left Firefox open overnight.
When I disable this extension, page loads immediately improve.
I don't have this extension on private windows, and those load quickly and normally when normal windows are not.
I have eight containers defined, with a variety of websites opening in each. My work one in particular has ~20 sites defined.
I'm also seeing this problem on 75.0 on Mac 10.13.6. I have 20 containers, some with 1 or 2 sites defined, some with around 8 sites defined.
Next time someone encounters this, try going to https://profiler.firefox.com/ and capturing a profile. I tried on the "Firefox Front-end" capture profile and saw a large amount of CPU time, 75% or so, spent in a JS Async/Await function and a lot of calls related to "Sync", so it must be a regression caused by the new syncing feature in 6.2. Some kind of tight loop attempting to sync too frequently.
Unfortunately I had to drop what I was doing and didn't upload the profile, and haven't reproduced the problem again, so maybe someone else can contribute a profile if they encounter the problem.
Here is a "Firefox Front-end" profile when I was experiencing the performance hit:
I started the profile, opened a new default/unassigned container tab, and navigated to Amazon which is set to automatically re-open in a shopping container. Once Amazon loaded I stopped the capture.
I set the capture to include extension information, but if I need to include other options please let me know.
I did one too, with an amazon tab set to open in shopping the same as Derek. Not sure I did it correctly, I've never used profiler before.
@bluevulpine @narq Thanks for these! The profiles look similar to what I saw on my machine.
To get a clearer picture when viewing the profile results, use the blue "tracks visible" dropdown at the top to show only WebExtensions process, and hit the radio button for "JavaScript" stack (next to All stacks and Native). Excessive CPU time spent in the promise/async/await tight loop, and looks like it's hitting IndexedDB a lot.
I've just done 2 traces with the settings you requested - another amazon loading from an empty tab into a shopping tab. And another example from an existing shopping tab, on aliexpress.com, just clicking on a link. When multi-account-containers is running, after a while, everything slows down very dramatically.
https://perfht.ml/2VHmNof - amazon from a an empty tab set to open in shopping container https://perfht.ml/2YcSWGc - clicking a link on aliexpress in pre-existing shopping container
Anyone have experience debugging WebExtensions? The code is commented decently and even has a mention of infinite loops; in fact this area of code might be the culprit, since the surrounding functions do show up in the profile captures:
If we suspect this code, then it could be checkForListenersMaybeAdd()
is getting called elsewhere, interleaved with the async execution of this block, and causing the infinite loop. There are only 2 other places it's called; either sync.init()
, or there is a caught exception:
I lack experience debugging WebExtensions though, not sure easiest way to set up an environment that we could trigger a sync and get some debug logs.
I think I have the solution. Could anyone verify if it fixes your problem? https://github.com/mozilla/multi-account-containers/pull/1757
Possibly. It's better than it was, and I thought it was fixed for a few days, but #1768 might be part of the same issue, and I'm unable to run it at the moment without my machines getting hammered.
1768 might be part of the same issue
Yeah, I think so too.
Hopefully it get fixed soon.
Has anyone had any luck with a solution for this problem? I have noticed that with the recent updates to Firefox & Nightly this has been getting much worse. I have Windows and Linux systems (multiple distros), so please let me know if there is anything I can do to help resolve this issue.
Can confirm that this is getting worse nightly on linux; One observation is that disabling the addon and enabling it right back again seems to fix it... my CPU idle usage hangs around 1%... when this addon goes wonky, it'll peg one core completely and go to 20%; After disabling/renabling, goes back to 1%
One observation is that disabling the addon and enabling it right back again seems to fix it
Yes I can confirm. This is also my workaround when it occurs. I go and check about:performance and when Firefox Multi-Account Containers is using 100% CPU I simply disable it for a second. This makes the problem go away for a while.
Actual behavior
When monitoring
about:performance
, for some reason the add-on seems to spike to 110-150+ on energy impact and going back down every 2-3 seconds. It persists a browser restart. I've also tried it on Nightly.I also have an issue where pages seem to have a long 2-3 seconds delay before starting to load, but I'm not sure if it's caused by this.
Expected behavior
Stable energy impact with decent page load speeds.
Steps to reproduce
about:performance
and monitor the usageNotes
Very likely similar to this issue https://github.com/mozilla/multi-account-containers/issues/572
┆Issue is synchronized with this Jira Task