This repository has been archived by the owner on Jan 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 758
[Console] Following link to large file from Console doesn't react for a while #4654
Labels
Comments
For the record, the workaround I used on #4705 also makes the performance of this scenario much better. |
I just looked into this and the slow down comes from our current strategy of blocking opening the debugger on fetching all of the sources.
We can speed up the debugger opening by not blocking:diff --git a/src/client/firefox.js b/src/client/firefox.js
index 0715faf..fb0a6d1 100644
--- a/src/client/firefox.js
+++ b/src/client/firefox.js
@@ -45,9 +45,9 @@ export async function onConnect(connection: any, actions: Object): Object {
// the debugger (if it's paused already, or if loading the page from
// bfcache) so explicity fire `newSource` events for all returned
// sources.
- const sources = await clientCommands.fetchSources();
+ clientCommands.fetchSources().then(sources => actions.newSources(sources));
+
await actions.connect(tabTarget.url);
- await actions.newSources(sources);
// If the threadClient is already paused, make sure to show a
// paused state. navigating to viewSourceWe can check the source map url service to see if the source has been seen before opening the debugger NoteOne thing to watch out for if we stop blocking the debugger opening is that we scroll when the source loads. |
Here is a sketch of what the changes could look like in the panel: diff --git a/devtools/client/framework/source-map-url-service.js b/devtools/client/framework/source-map-url-service.js
index fe4ff87..f2940f7 100644
--- a/devtools/client/framework/source-map-url-service.js
+++ b/devtools/client/framework/source-map-url-service.js
@@ -347,4 +347,6 @@ SourceMapURLService.prototype._onPrefChanged = function () {
}
};
+SourceMapURLService.prototype.hasSource = // YAY
+
exports.SourceMapURLService = SourceMapURLService;
diff --git a/devtools/client/shared/view-source.js b/devtools/client/shared/view-source.js
index 94a6dff..3ec74b6 100644
--- a/devtools/client/shared/view-source.js
+++ b/devtools/client/shared/view-source.js
@@ -59,8 +59,7 @@ exports.viewSourceInDebugger = Task.async(function* (toolbox, sourceURL, sourceL
// New debugger frontend
if (Services.prefs.getBoolPref("devtools.debugger.new-debugger-frontend")) {
- const source = dbg.getSource(sourceURL);
- if (source) {
+ if (toolbox.sourceMapService.hasSource(sourceURL)) {
yield toolbox.selectTool("jsdebugger");
dbg.selectSource(sourceURL, sourceLine);
return true; |
p1 of this fix: https://reviewboard.mozilla.org/r/222292/ |
jasonLaster
changed the title
Following link to large file from Console doesn't react for a while
[Console] Following link to large file from Console doesn't react for a while
Mar 14, 2018
Works snappy for me now. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
STR:
AR:
ER:
The text was updated successfully, but these errors were encountered: