Closed Bug 1943130 Opened 1 year ago Closed 1 year ago

Breakable lines are fetch twice in the debugger frontend

Categories

(DevTools :: Debugger, enhancement)

enhancement

Tracking

(firefox137 fixed)

RESOLVED FIXED
137 Branch
Tracking Status
firefox137 --- fixed

People

(Reporter: ochameau, Assigned: ochameau)

References

Details

(Keywords: perf-alert)

Attachments

(1 file)

While investigating bug 1942774, I saw duplicated actions for retrieving breakable lines of each source.
We were also unconditionaly fetching breakable lines of all HTML sources, regardless of them being selected or not.
This may have led to performance troubles on websites having many iframes or iframe with large html page.

We can't use either memoizableAction, nor the promise middleware.

  • memoizableAction helps memoize on the long run,
    but doesn't handle mutliple calls made for the same ressource
    before the async computation of the value.
  • promise middleware explicitely prevents exposing the actual
    Promise to the reducer, which prevents exposing it to the selector.

Ultimately, we have to expose that async promise done to compute the reducer data,
that's the one the frontend should wait for on any subsequent run for the same ressource.

These two existing APIs are weak and should probably be removed in favor
of something similar to the current patch.
Last, but not least, this approach doesn't leak all data indefinitely
until DevTools closes (memoizableAction does)

Also tweak the new-source action in order to force fetching breakable lines
of HTML sources, only if that source is currently selected.
We were computing breakable lines for all HTML sources, for example when
having iframes.

Assignee: nobody → poirot.alex
Status: NEW → ASSIGNED
Pushed by apoirot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/cb56e068ecea [devtools] Avoid fetching breakable lines more than once per source. r=devtools-reviewers,bomsy
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 137 Branch

(In reply to Pulsebot from comment #2)

Pushed by apoirot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/cb56e068ecea
[devtools] Avoid fetching breakable lines more than once per source.
r=devtools-reviewers,bomsy

Perfherder has detected a devtools performance change from push cb56e068ecea83724815f25fc65bdc652c412d42.

Improvements:

Ratio Test Platform Options Absolute values (old vs new)
8% damp complicated.jsdebugger.close.DAMP windows11-64-shippable-qr e10s fission stylo webrender 11.54 -> 10.61

Details of the alert can be found in the alert summary, including links to graphs and comparisons for each of the affected tests.

If you need the profiling jobs you can trigger them yourself from treeherder job view or ask a sheriff to do that for you.

You can run these tests on try with ./mach try perf --alert 44220

For more information on performance sheriffing please see our FAQ.

Keywords: perf-alert
Regressions: 1952527
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: