Closed Bug 1794686 Opened 2 years ago Closed 2 years ago

Poor performance on some pages with Facebook Container enabled

Categories

(WebExtensions :: Developer Outreach, defect, P1)

defect

Tracking

(Not tracked)

RESOLVED MOVED

People

(Reporter: mconley, Unassigned)

References

Details

(Whiteboard: [addons-jira])

This just started happening to me in today's Nightly (107.0a1, 2022-10-11, 20221011093208 on macOS).

If I have the Facebook Container add-on installed and enabled, and if I then visit, for example, https://sql.telemetry.mozilla.org/dashboard/picture-in-picture, the CPU and memory usage of the WebExtension process goes out of control, and the parent process becomes much much less responsive.

Here's a profile: https://share.firefox.dev/3MlsYHv

Disabling the Facebook Container WebExtension seemed to fix the issue almost immediately.

Considering how many people use the Facebook Container WebExtension, we should probably figure out what's going on here in the short term.

Hey rpl, might this be related to recent MV3 work that's been going on?

Flags: needinfo?(lgreco)

I think this is probably the extension's fault. Most of the time is spent in detectFacebookOnPage in the content script and checkIfTrackersAreDetected in the background. A big slice of that time is spent in sending messages to the parent for API calls, but about half of that is in the actor messaging code, which we know generally does not cause performance problems.

My suspicion is that the extension winds up calling contentScriptInit way more than it intends to. Especially after looking at the request listener that triggers it.

(In reply to Mike Conley (:mconley) (:⚙️) from comment #1)

Hey rpl, might this be related to recent MV3 work that's been going on?

I am not Luca but I am also not sure it is related to our on-going work on MV3. This issue on GitHub describes the same problem but on Release (and ESR in a comment), not Nightly: https://github.com/mozilla/contain-facebook/issues/883. That being said, it's weird that we only hear about this problem in the last 24 hours (this bug, the GitHub issue linked previously and some other comments on Reddit).

:mconley when was the FB Container extension last updated (to 2.3.5, I suppose) for you in about:addons?

Flags: needinfo?(mconley)

We have reverted the version to the previous one and pushed it as an update (version 2.3.6).

As :kmag hinted (later confirmed by :rpl on Slack), the underlying issue was in the extension code so I am going to move the bug and close it. We'll open an issue on GitHub to fix the issue in the extension.

(/me also clears the needinfos)

Status: NEW → RESOLVED
Closed: 2 years ago
Component: General → Developer Outreach
Flags: needinfo?(mconley)
Flags: needinfo?(lgreco)
Resolution: --- → MOVED
Performance Impact: ? → ---
Severity: -- → S2
Priority: -- → P1
Whiteboard: [addons-jira]
You need to log in before you can comment on or make changes to this bug.