Create the unprivileged junk scope lazily, and hold it weakly
Categories
(Core :: XPConnect, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox79 | --- | fixed |
People
(Reporter: kmag, Assigned: kmag)
References
(Blocks 1 open bug)
Details
(Keywords: perf-alert)
Attachments
(4 files)
In the best case, the unprivileged junk scope occupies at least 10KB of memory per content process, even if it's never used. When it is used for ephemeral objects, that number climbs even higher as lazy prototypes for built-in objects are instantiated and then held alive forever.
We can solve both of these problems by only creating the global when it's needed, and letting it get GCed when none of the objects that were created in it are left to hold it alive.
Comment 1•4 years ago
|
||
Looks like you dropped a word from the summary.
Assignee | ||
Comment 2•4 years ago
|
||
Prior to this patch set, XPConnect always created the first compartment in the
system zone with a content principal. The subsequent patches make that
global's creation lazy, which leads us to create the first compartment in the
system zone with the system principal and the NewCompartmentInSystemZone
specifier. In that case, we call setIsSystemZone()
when we create the zone,
because the compartment has the system principal, and then call it again when
we try to store it in rt->gc.systemZone
, which leads to a failed assertion.
This patch fixes that.
Assignee | ||
Comment 3•4 years ago
|
||
Assignee | ||
Comment 4•4 years ago
|
||
Assignee | ||
Comment 5•4 years ago
|
||
Updated•4 years ago
|
Updated•4 years ago
|
Comment 7•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/56434e256a52
https://hg.mozilla.org/mozilla-central/rev/821960c5fa97
https://hg.mozilla.org/mozilla-central/rev/93bca0225002
https://hg.mozilla.org/mozilla-central/rev/a6b021b3776a
Comment 8•4 years ago
|
||
== Change summary for alert #26362 (as of Sat, 27 Jun 2020 23:27:31 GMT) ==
Improvements:
1% Base Content JS macosx1014-64-shippable opt 3,552,944.17 -> 3,533,568.67
0.48% Base Content JS linux1804-64-shippable-qr opt 3,536,240.67 -> 3,519,154.67
0.47% Base Content JS linux1804-64-shippable opt 3,536,002.67 -> 3,519,258.33
0.36% Base Content JS windows10-64-shippable-qr opt 3,593,522.00 -> 3,580,680.00
For up to date results, see: https://treeherder.mozilla.org/perf.html#/alerts?id=26362
Description
•