Closed Bug 1521540 Opened 2 years ago Closed 2 years ago

improve sourceMapURL performance

Categories

(DevTools :: Debugger, enhancement, P2)

enhancement

Tracking

(firefox66 fixed)

RESOLVED FIXED
Firefox 66
Tracking Status
firefox66 --- fixed

People

(Reporter: jlast, Assigned: jlast)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

General Debugger slowness (https://github.com/devtools-html/debugger.html/issues/7734) helped us find a slow path in sourceMapURL

diff --git a/devtools/server/actors/source.js b/devtools/server/actors/source.js
index 02fa3f38f1e7..13d4f13b908a 100644
--- a/devtools/server/actors/source.js
+++ b/devtools/server/actors/source.js
@@ -187,6 +187,15 @@ const SourceActor = ActorClassWithSpec(sourceSpec, {
     return this._addonPath;
   },

+  get sourceMapURL() {
+    if (this._sourceMapURL) {
+      return this._sourceMapURL;
+    }
+
+    this._sourceMapURL = source ? source.sourceMapURL : null
+    return this._sourceMapURL;
+  },
+
   get isCacheEnabled() {
     if (this.threadActor._parent._getCacheDisabled) {
       return !this.threadActor._parent._getCacheDisabled();
@@ -209,7 +218,7 @@ const SourceActor = ActorClassWithSpec(sourceSpec, {
       addonID: this._addonID,
       addonPath: this._addonPath,
       isBlackBoxed: this.threadActor.sources.isBlackBoxed(this.url),
-      sourceMapURL: source ? source.sourceMapURL : null,
+      sourceMapURL: this.sourceMapURL,
       introductionUrl: introductionUrl ? introductionUrl.split(" -> ").pop() : null,
       introductionType: source ? source.introductionType : null,
     };

we could also memoize here which would be better?

No longer depends on: 1521539
Attached image sourcemapurl.png
Priority: -- → P2

I'm going to re-purpose this bug and focus on the fact that serializing the source actor for frame forms can be slow because of sourceMapURL.

Blocks: dbg-perf-q1
Pushed by jlaster@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/e3f2ecc94174
Replace Frame.source form with Frame.actor. r=lsmyth
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 66
Assignee: nobody → jlaster
You need to log in before you can comment on or make changes to this bug.