Closed Bug 1710671 Opened 4 years ago Closed 4 years ago

Prepare HttpHandler AcceptLanguages during process pre-allocation

Categories

(Core :: Networking: HTTP, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
90 Branch
Fission Milestone M8
Tracking Status
firefox90 --- fixed

People

(Reporter: jesup, Assigned: jesup, NeedInfo)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fission-perf])

Attachments

(1 file)

At the first load a process does, we collect the AcceptLanguages strings and mark it clean; this can take 3-4ms on a fast SSD machine (linux at least, likely similar for mac/windows). This occurs during fission process-switch when a new process is allocated (i.e. often) and at a critical time since this delays important parts of the initial load.

If we can set the AcceptLanguages during preallocation it will already be 'clean' and we should see a ~10% reduction in process-switch time.

Randell has been discussing this with Dragana.

Fission Milestone: ? → M8
Blocks: fission-perf

AcceptLanguages is set only once. We can make it static. I am wondering if we can just send the value from the parent process during init and avoid calling this .

I assume that this is taking 3-4ms. Let me know if I understood something wrong from our chat.

Assignee: nobody → rjesup
Status: NEW → ASSIGNED

The time is mostly in reading the files for the localized string, mostly due to the sandbox I believe.
I don't think we can avoid the normal logic to set it when it's dirty (when prefs change), but we could ship the current value to the content process at startup instead of calling SetAcceptLanguages directly. We'd have to make sure we instantiated nsHttpHandler at this time though to ensure we catch any pref changes, and there might be a window between process-start and when the child gets the accept languages value where we might miss a pref change. I'm sure we could design something to avoid any holes like this, but the simple version I have here should work and be easy to maintain, even if it uses a little extra CPU in the prealloc phase.

Pushed by rjesup@wgate.com: https://hg.mozilla.org/integration/autoland/rev/e7187a1150ae do SetAcceptLanguages during process preallocation to reduce first-use overhead (especially for process-switch) r=dragana,necko-reviewers
Flags: needinfo?(rjesup)
Pushed by rjesup@wgate.com: https://hg.mozilla.org/integration/autoland/rev/05c26697326a do SetAcceptLanguages during process preallocation to reduce first-use overhead (especially for process-switch) r=dragana,necko-reviewers
Pushed by rjesup@wgate.com: https://hg.mozilla.org/integration/autoland/rev/b470431a9538 do SetAcceptLanguages during process preallocation to reduce first-use overhead (especially for process-switch) r=dragana,necko-reviewers
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 90 Branch
Blocks: 1711043
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: