Closed Bug 1617300 Opened 4 years ago Closed 2 years ago

First http-on-opening-request observer notification takes longer in Fenix than Fennec, spending time in ExtensionProcessScript.jsm and ExtensionChild.jsm

Categories

(GeckoView :: Extensions, defect, P2)

Unspecified
All

Tracking

(Performance Impact:medium)

RESOLVED INVALID
Performance Impact medium

People

(Reporter: sefeng, Unassigned)

References

Details

(Keywords: perf:pageload)

Fennec profile: https://perfht.ml/2Viz8Qh
Fenix profile: https://perfht.ml/32fK3eR

I collected both profile by using browsertime. According to the profiles, Fenix NotifyObserver stuff's took more than than Fennec before the first paint. They are related to some extension related code.

There are two observer notifications in particular that are taking longer:

  • The first http-on-opening-request notification (which is sent inside the location.href setter), and
  • the initial-document-element-inserted notification.

Both are spending time in code that looks related to extension content script infrastructure.

Summary: NotifyObserver takes longer in Fenix than Fennec for some javascript code related extension. → First http-on-opening-request observer notification takes longer in Fenix than Fennec, spending time in ExtensionProcessScript.jsm and ExtensionChild.jsm

In this profile, they're taking 74ms and 77ms, so it seems like just the extension content script infrastructure is adding 150ms even if no add-ons actually need to intercept network requests.
This code runs before the first paint.

Rank: 2
Priority: -- → P2

here's another profile : https://perfht.ml/2PIeNzY

Above two were taken by browsertime, and this one https://perfht.ml/38fTJY4 was taken by hand. I typed the url in the url bar manually.
This call delays the time of when the network is being handled in the parent process.

Blocks: 1604930
Blocks: 1604252
Blocks: 1602508
Whiteboard: [geckoview:m77]
Component: General → Extensions
Flags: needinfo?(agi)
Whiteboard: [geckoview:m77]
Depends on: 1601067
Flags: needinfo?(agi)
Whiteboard: [geckoview:m78]
Whiteboard: [geckoview:m78] → [geckoview:m79]
Whiteboard: [geckoview:m79]

(In reply to Markus Stange [:mstange] from comment #2)

In this profile, they're taking 74ms and 77ms, so it seems like just the extension content script infrastructure is adding 150ms

Much of this extra time is spent in script parsing / emit. So I expect bug 1632682 to help reduce this time.

Depends on: 1632682

Hey Sean,
do you think it's still a problem we have? Maybe you could help gather a new profile for this?
Thanks!

Performance Impact: --- → P2
Keywords: perf:pageload
Flags: needinfo?(sefeng)

In my newly taken profile. NotifyObserver only took a marginal amount of time. I think this situation has been much improved.

I am going to close this issue as INVALID.

Status: NEW → RESOLVED
Closed: 2 years ago
Flags: needinfo?(sefeng)
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.