Closed
Bug 900292
Opened 11 years ago
Closed 10 years ago
Enable lazy parsing for self-hosting JS
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: till, Assigned: till)
References
Details
(Keywords: perf)
Attachments
(1 file, 1 obsolete file)
8.31 KB,
patch
|
Details | Diff | Splinter Review |
On my machine, JSRuntime::initSelfHosting takes about 9ms. When I remove all the PJS-related code, that goes down to 6ms. Additionally removing the Intl-related code makes that 1.9ms. So enabling Intl adds 4.1ms. Given that Talos runs on hardware that is quite a bit slower, I guess the 4.1ms translate to maybe 8ms or 10ms in Ts. Enabling lazy parsing for self-hosted JS should enable us to claim back a good part of that.
Assignee | ||
Comment 1•11 years ago
|
||
This almost works. It causes some weird test failures still, which I have to track down. However, it doesn't really do anything for the time spent under JSRuntime::initSelfHosting. Without Intl, the duration is basically flat. With Intl, it goes down by ~1ms: from ~6ms to ~5ms. I'm not sure I understand why that is: with PJS (which uses destructuring a lot, so will cause full parsing for most functions) removed, all but five fairly small functions get compiled lazily (measured by printf-ing at the ends of the two `finishFunctionDefinition` functions). All in all, lazily parsing the self-hosting code might not be worth it. Or I'm just doing something wrong with my measurements.
Assignee | ||
Updated•11 years ago
|
Assignee: general → till
Status: NEW → ASSIGNED
Comment 2•11 years ago
|
||
Is the syntax parser getting disabled at some point? I.e. is FullParseHandler::disableSyntaxParser ever called?
Assignee | ||
Comment 3•11 years ago
|
||
(In reply to Brian Hackett (:bhackett) from comment #2) > Is the syntax parser getting disabled at some point? I.e. is > FullParseHandler::disableSyntaxParser ever called? It was, before I changed the `let` in Utilities.js:90 to a `var`. But it's not called for the runs I measured.
Comment 4•11 years ago
|
||
Attachment #785811 -
Attachment is obsolete: true
Comment 5•10 years ago
|
||
Till: do we still want lazy parsing of self-hosted JS? Now that we fork B2G content processes using Nuwa, does JSRuntime::initSelfHosting() time matter much?
Flags: needinfo?(till)
Keywords: perf
Assignee | ||
Comment 6•10 years ago
|
||
Yeah, not only don't we want it anymore: it's outright impossible. The self-hosting compartment is shared per-process and must be read-only after startup, so all parsing has to have happened at that point.
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Flags: needinfo?(till)
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•