Lazily initialize helper thread JSContexts
Categories
(Core :: JavaScript Engine, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox100 | --- | fixed |
People
(Reporter: mccr8, Assigned: jandem)
References
(Blocks 1 open bug)
Details
(Whiteboard: [overhead:40k])
Attachments
(2 files)
4.67 KB,
patch
|
Details | Diff | Splinter Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
From bug 1643170, comment 2:
(In reply to Jan de Mooij [:jandem] from comment #2)
For what it's worth, we could easily initialize this more lazily. Most helper thread tasks don't request a JSContext anymore.
We have parsing (will be fixed short-term-ish after Stencil) and some GC tasks. On the other hand, if we can remove this completely later this year maybe we should just wait for that.
The total memory usage for these JSContexts is something like 40kb for the 8 JSContexts, though probably some of these would get initialized even in a small process.
Updated•5 years ago
|
Assignee | ||
Comment 1•5 years ago
|
||
I looked into this a bit. We can do this in getFirstUnusedContext
, but the problem is that GC creates a lot of parallel-tasks so we'd end up allocating most of these contexts in every process anyway.
It would be nice for the GC's parallel tasks to be decoupled from JSContext, maybe with some custom TLS struct that has just the GC-specific bits. Then if we do the same for parse tasks after Stencil we could remove helper thread contexts completely.
Assignee | ||
Comment 2•5 years ago
|
||
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 3•3 years ago
|
||
Now that these are only used for off-thread parsing, we can save some memory in
most content processes.
Comment 5•3 years ago
|
||
bugherder |
Description
•