Add telemetry for memory consumed by content scripts

NEW
Assigned to

Status

P2
normal
2 years ago
4 months ago

People

(Reporter: kmag, Assigned: kmag)

Tracking

(Blocks: 2 bugs)

51 Branch
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [metrics] triaged)

(Assignee)

Description

2 years ago
I've come across several add-ons recently that inject huge amounts of code as content scripts into every top-level page (and sometimes into every frame). If this is a common enough pattern, it could cause serious performance problems for large chunks of our users.

We should try to gather some basic telemetry to make sure this doesn't actually become a problem.

It also might be worth showing console warnings when add-ons inject non-trivial scripts into all URLs.

Updated

2 years ago
Priority: -- → P1
Whiteboard: metrics, triaged

Updated

2 years ago
Assignee: nobody → kmaglione+bmo
In our quality planning meeting we discussed wanting to track metrics for both time spent loading content scripts, as well as the memory consumed by content scripts. I am going to take the former while Kris will handle the latter, so this should probably be split into two bugs. Do you agree, Kris?

Should we also open a separate bug for "showing console warnings when add-ons inject non-trivial scripts into all URLs"?
Blocks: 1352992
Flags: needinfo?(kmaglione+bmo)
Whiteboard: metrics, triaged → [metrics] triaged

Comment 2

2 years ago
I'm interested in the comment "showing console warnings when add-ons inject non-trivial scripts into all URLs", how do you determine non-trivial in this case? Is this something that can be caught statically or are you planning on basing it on runtime information?
(Assignee)

Comment 3

2 years ago
(In reply to Andy McKay [:andym] from comment #2)
> I'm interested in the comment "showing console warnings when add-ons inject
> non-trivial scripts into all URLs", how do you determine non-trivial in this
> case? Is this something that can be caught statically or are you planning on
> basing it on runtime information?

That's yet to be determined. Probably based on the average amount of time it takes to inject them, e.g., >15ms or so. We could probably try to statically estimate it based on script size and parse tree complexity, though. It might be worth doing.
Flags: needinfo?(kmaglione+bmo)
I have created bug 1356323 to split off the "time spent" probe from the "memory consumed" probe. It's still unclear whether we need to split off an additional bug for the conversation that Kris and Andy are having above.
Summary: Add telemetry for time and memory spent injecting content scripts → Add telemetry for memory consumed by content scripts
(Assignee)

Updated

a year ago
Blocks: 1381709
This is an assigned P1 bug without activity in two weeks. 

If you intend to continue working on this bug for the current release/iteration/sprint, remove the 'stale-bug' keyword.

Otherwise we'll reset the priority of the bug back to '--' on Monday, August 28th.
Keywords: stale-bug

Updated

a year ago
Keywords: stale-bug

Updated

a year ago
Priority: P1 → P2

Updated

4 months ago
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.