Closed
Bug 1399090
Opened 7 years ago
Closed 7 years ago
Responsive design toolbox button force loading many RDM dependencies
Categories
(DevTools :: Responsive Design Mode, enhancement)
DevTools
Responsive Design Mode
Tracking
(firefox57 fixed)
RESOLVED
FIXED
Firefox 57
Tracking | Status | |
---|---|---|
firefox57 | --- | fixed |
People
(Reporter: ochameau, Assigned: ochameau)
References
(Blocks 2 open bugs)
Details
Attachments
(1 file)
https://perfht.ml/2w4zbUp
When inserting RDM icon in the toolbox toolbar, we end up loading responsivedesign.jsm which takes 3.9ms / 1.2% of overall JS computing in parent process.
Assignee | ||
Comment 1•7 years ago
|
||
With this patch we go down to 0.5ms / 0.2% for loading responsivedesign.jsm:
https://perfht.ml/2w577A1
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Comment 4•7 years ago
|
||
This patch moves most of
devtools/client/responsivedesign/responsivedesign.jsm
to
devtools/client/responsivedesign/responsivedesign-old.js
as it is all related to the old RDM.
Then, I added lazy loading in devtools/client/responsive.html/manager.js
so that we end up only loading a very small responsivedesign.jsm and only manager.js (and none of its deps).
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → poirot.alex
Assignee | ||
Comment 5•7 years ago
|
||
No particular win reported by DAMP:
https://treeherder.mozilla.org/perf.html#/comparesubtest?originalProject=mozilla-central&newProject=try&newRevision=0e3164dff0d4853595075f0a1c46f18abd154d53&originalSignature=edaec66500db21d37602c99daa61ac983f21a6ac&newSignature=edaec66500db21d37602c99daa61ac983f21a6ac&filter=.open&framework=1&selectedTimeRange=172800
(Anything under 5% win is most likely invisible to DAMP)
Comment 6•7 years ago
|
||
mozreview-review |
Comment on attachment 8907043 [details]
Bug 1399090 - Lazy load responsive design manager modules.
https://reviewboard.mozilla.org/r/178768/#review183992
Thanks, looks like a good cleanup and perf improvement! :)
It seems like we could go further though, maybe in a follow up bug / patch. Is there any reason for the new vs. old switch to be a JSM? Can we convert it to a regular module instead?
I also noticed some references to RDM in `browser.js` that seem like dead code now that DevTools manages menus and shortcuts:
http://searchfox.org/mozilla-central/rev/51eae084534f522a502e4b808484cde8591cb502/browser/base/content/browser.js#8467-8477
(Perhaps the Scratchpad part is dead as well.)
::: devtools/client/responsivedesign/responsivedesign-old.js:1
(Diff revision 2)
> -"use strict";
> -
> -const Cu = Components.utils;
> -
> -const { loader, require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
> const { LocalizationHelper } = require("devtools/shared/l10n");
New file needs license header.
::: devtools/client/responsivedesign/responsivedesign-old.js:130
(Diff revision 2)
> }
> })
> };
>
> EventEmitter.decorate(Manager);
> +exports.Manager = Manager;
Rename the `Manager` object to `ResponsiveUIManager` in the new file. This way both new and old use the same name. (I only changed to `Manager` when adding the new / old switch because of some ESLint rule.)
::: devtools/client/responsivedesign/responsivedesign-old.js:259
(Diff revision 2)
>
> this.showNewUINotification();
>
> // Notify that responsive mode is on.
> this._telemetry.toolOpened("responsive");
> - ResponsiveUIManager.emit("on", { tab: this.tab });
> + Manager.emit("on", { tab: this.tab });
These renames can all be reverted with the name change above.
Attachment #8907043 -
Flags: review?(jryans) → review+
Assignee | ||
Comment 7•7 years ago
|
||
Assignee | ||
Comment 8•7 years ago
|
||
(In reply to J. Ryan Stinnett [:jryans] (use ni?) from comment #6)
> Comment on attachment 8907043 [details]
> Bug 1399090 - Lazy load responsive design manager modules.
>
> https://reviewboard.mozilla.org/r/178768/#review183992
>
> Thanks, looks like a good cleanup and perf improvement! :)
>
> It seems like we could go further though, maybe in a follow up bug / patch.
> Is there any reason for the new vs. old switch to be a JSM? Can we convert
> it to a regular module instead?
Opened bug 1399449.
> I also noticed some references to RDM in `browser.js` that seem like dead
> code now that DevTools manages menus and shortcuts:
>
> http://searchfox.org/mozilla-central/rev/
> 51eae084534f522a502e4b808484cde8591cb502/browser/base/content/browser.
> js#8467-8477
>
> (Perhaps the Scratchpad part is dead as well.)
That's bug 1250832, I think I will proceed with all these cleanups early during 58 cycle.
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment 11•7 years ago
|
||
Pushed by apoirot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/665aadca9d5f
Lazy load responsive design manager modules. r=jryans
Comment 12•7 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox57:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 57
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•