Closed Bug 1462669 Opened 6 years ago Closed 6 years ago

Extension dev: Presence of "node_modules" causes very slow extension load

Categories

(Firefox :: Untriaged, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1455402

People

(Reporter: arantius, Unassigned)

References

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0 Build ID: 20180516032328 Steps to reproduce: Clicked "load temporary add-on" from about:debugging, with some dev-only "node_modules" dependencies in the same directory. Actual results: It took >10 seconds of 100% CPU activity for the extension to load. Expected results: It should have taken 100-500ms max for the extension to load. Root cause/STR: 1. Checkout Greasemonkey from https://github.com/greasemonkey/greasemonkey.git 2. Launch Firefox nightly, in a blank/fresh profile ( 62.0a1 2018-05-18; Built from https://hg.mozilla.org/releases/mozilla-release/rev/afa87f9be3a8852da3a30f286b15ae599c7874f6 ) 3. Open about:debuggong 4. "Load Temporary Add-on" and select the code from step 1 Result: Almost instantly (no more than half a second?) the extension loads. (And its first-run behavior launches a tab.) In that checked out copy of the code, run "npm install". Click remove and then load the add-on again. This time I get ~150% CPU utilization (more than one core), for around ten seconds. Every time I hit "reload" I get this same delay. Remove the "node_modules" directory and it's fast again, very sub-second, almost imperceptible delay to reload. Repeat with Firefox stable (60.0.1; Built from https://hg.mozilla.org/releases/mozilla-release/rev/03d4f76300bedeffd47c726ce7fee0221873da11) and it's fast whether I have a node_modules or not. Repeat with 61.0b6 ( Built from https://hg.mozilla.org/releases/mozilla-beta/rev/0315d341f73f3385f7bf58f0687d66f621fd9316 ) and it's slow. So it happened somewhere between 60 and 61b6. Nothing in the extension code refers to the node_modules directory. It's only there to power unit testing through commands run in the shell, unrelated to Firefox. Its presence should not affect how long it takes to load my extension into Firefox.
This may be related to the same underlying issue of Bug 1455402 (computing the size of the addon). I'm adding Bug 1455402 as a "see also" in the meantime.
See Also: → 1455402
See Also: → 1462976
Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.