Don't start parser worker if it's not needed
Categories
(DevTools :: Console, defect)
Tracking
(firefox81 fixed)
Tracking | Status | |
---|---|---|
firefox81 | --- | fixed |
People
(Reporter: nchevobbe, Assigned: nchevobbe)
Details
Attachments
(1 file)
In https://searchfox.org/mozilla-central/rev/8df04ff073d0fa70f692935c5dcddc0e23cb0117/devtools/client/webconsole/webconsole.js#304 , we check if the expression contains await
, and in such case, transform the input to handle top-level await expressions.
The catch is that we first check the existence of this.parserService
.
The getter for parserService
will start the parser worker if it wasn't the case yet (https://searchfox.org/mozilla-central/rev/8df04ff073d0fa70f692935c5dcddc0e23cb0117/devtools/client/webconsole/webconsole.js#320-335)
So doing the check first means we'll always spawn the parser worker, even if it's not going to be used, which consumes unnecessary resources.
Assignee | ||
Comment 1•5 years ago
|
||
In getMappedExpression
, we check if the expression contains await
, and in
such case, transform the input to handle top-level await expressions.
The catch is that we first check the existence of this.parserService, and the
getter for parserService will start the parser worker if it wasn't the case yet.
That means we were always spawning the parser worker, even if it wasn't going
to be used, consuming unnecessary resources.
This patch only reverts the conditions in the if.
Comment 3•5 years ago
|
||
bugherder |
Description
•