Closed Bug 1482392 Opened 4 years ago Closed 2 years ago

Track webextension Javascript activity

Categories

(Toolkit :: Performance Monitoring, enhancement, P2)

enhancement

Tracking

()

RESOLVED WONTFIX

People

(Reporter: tarek, Assigned: tarek)

Details

Attachments

(1 obsolete file)

Let's add a counter that will receive duration values and event loop iterations (==dispatches), 
so we know how long a webext spends in the JS runtime.

current implementation plan:

- add a global hashtable [WebExtensionId / duration+dispatch] 
- add in the runtime performanceMonitoring a set of functions so we can label it with the WebExtensionId
- in XPCJSRuntime::Initialize, if the principal has an addonId, create an entry in the table and flag the context runtime with it
- in AutoStopwatch, if the cx is flagged, we can measure the time spent via enter/leave (and iterations)

For the consumers, create a promise that asks all processes their global hashtable, and returns a merged, JS-friendly array, exposed via the extension framework.
related : bug 1309946 - which was the previous implementation of the "This addon might slow down etc..."
related : bug 1406872 -- it can probably be done in the same patch
This is a first draft for the patch that tracks WebExtension JS
activity, for early feedback.
Attachment #9008324 - Attachment description: Bug 1482392 - [WIP] Track webextension Javascript activity - r?jandem → Bug 1482392 - Track Web Extensions Javascript activity - r?jandem
Attachment #9008324 - Attachment description: Bug 1482392 - Track Web Extensions Javascript activity - r?jandem → Bug 1482392 - Track Web Extensions Javascript activity - r?jandem,florian
Attachment #9008324 - Attachment description: Bug 1482392 - Track Web Extensions Javascript activity - r?jandem,florian → Bug 1482392 - Track Web Extensions Javascript activity - r?jandem,baku,florian
Attachment #9008324 - Attachment is obsolete: true
Priority: -- → P2
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.