Closed
Bug 1663418
Opened 6 months ago
Closed 6 months ago
Get rid of the O(n^2) loop in ChromeUtils::RequestProcessInfo
Categories
(Core :: DOM: Content Processes, defect)
Core
DOM: Content Processes
Tracking
()
RESOLVED
FIXED
82 Branch
Tracking | Status | |
---|---|---|
firefox82 | --- | fixed |
People
(Reporter: Yoric, Assigned: Yoric)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
No description provided.
Assignee | ||
Updated•6 months ago
|
Assignee: nobody → dteller
Assignee | ||
Comment 1•6 months ago
|
||
Prior to this patch, RequestProcInfo attempts to examine all processes from mozilla::ipc::GeckoChildProcessHost::GetAll callbacks.
This causes two issues:
- lifetime management for raw
ContentProcess*
used during the callbacks works but is complicated to audit; - for each
GeckoChildProcessHost
identified as aContentProcess
, we need to perform a linear lookup within content processes during each callback, which makes the code O(n^2) where n is the number of content processes.
This patch rewrites this section of RequestProcInfo
by splitting it as follows:
- We use the same
GeckoChildProcessHost::GetAll
callback to examine non-ContentProcess, without any lookup. - We use the list of
ContentProcess
to examine ContentProcesses, without any lookup.
New code is a bit longer (138 loc vs. 115) but not as deeply nested, which should be an acceptable tradeoff.
Pushed by dteller@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b0e9cfc9e157 Faster path for ContentProcess in RequestProcInfo;r=froydnj
Comment 3•6 months ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 6 months ago
status-firefox82:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 82 Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•