Merge CustomizableUI.jsm and CustomizableWidgets.jsm to reduce compartment overhead
Categories
(Firefox :: Toolbars and Customization, defect)
Tracking
()
People
(Reporter: mconley, Unassigned)
References
(Blocks 1 open bug)
Details
(Whiteboard: [Australis:P-])
Updated•11 years ago
|
Comment 1•9 years ago
|
||
Comment 2•9 years ago
|
||
Comment 3•9 years ago
|
||
Reporter | ||
Comment 4•3 years ago
|
||
Hey arai, am I right in recalling that all privileged JSMs (and ESMs) within the same process are loaded in the same memory compartment these days, and that there'd be not much in the way of memory savings to merge the two JSMs mentioned in this bug?
Comment 5•3 years ago
|
||
yes, JSMs and system ESMs share the single global and they're in single compartment,
and merging 2 JSMs doesn't contribute to memory saving around that.
There's still slight overhead, such like the following, but at least memory consumption part is negligible compared to global/compartment which had many duplication.
- runtime memory overhead
- per-JSM global
this
object, for storing global variables - script source's properties (js::ScriptSource and js::ScriptSourceObject)
- top-level script's properties (js::BaseScript)
- per-JSM global
- load performance (both raw JSM file and cache)
- string (including identifiers) atomization is performed for each file (atom table lookup is performed multiple times if 2 files have same strings)
- cache (serialization) filesize and encode/decode
- strings (including identifiers) are encoded for each file, unless they're well-known names or 1-2 length
#include
way can avoid all of them.
loadSubScript
can avoid the per-JSM global this
, but not others.
anyway, I think it's better using simple way as much as possible, and keep using multiple JSMs (and ESMs) would be the way to go,
unless we bump into other perf/memory issue with above or something else.
Reporter | ||
Comment 6•3 years ago
|
||
Okay, closing this out as a WONTFIX then. Thanks, arai!
Description
•