Closed Bug 1879575 Opened 3 months ago Closed 2 months ago

Content process freeze when opening the devtools in a project that has a lot of files in the same directory

Categories

(DevTools :: Debugger, defect)

defect

Tracking

(Performance Impact:?, firefox124 fixed)

RESOLVED FIXED
124 Branch
Performance Impact ?
Tracking Status
firefox124 --- fixed

People

(Reporter: julienw, Assigned: ochameau)

References

Details

Attachments

(1 file)

STR:

  1. Clone the repository https://github.com/julienw/devtools-sort-sources-problem
  2. Run npm i then npm run dev in it
  3. Open http://localhost:5173 (or whatever other link displayed in the terminal)
  4. Open the devtools

=> When the sources are discovered, the content process freezes during a few seconds.

A profile (https://share.firefox.dev/3HUebSA) shows a problem in https://searchfox.org/mozilla-central/rev/c036a209f5a2c3163d1277ee2b7becaab2f79dbd/devtools/client/debugger/src/reducers/sources-tree.js#344-345

We're sorting each time we add a new file in a specific directory (I think).

The problem in the project is how we import icons. The MUI documentation says we should do this:

import AbcIcon from '@mui/icons-material/Abc';

But I did this instead

import { Abc as AbcIcon } from '@mui/icons-material';

As a result, I believe all of the icons-material library is loaded. In this library all files are in the same directory.

If in my project I use the recommended way to import icons, I don't have the problem anymore.

Opening the directory in the Sources view is also pretty slow, here is a profile: https://share.firefox.dev/49w46Hw
This might just be because the file list in this directory is very long and therefore there are a lot of things to display (500ms Reflow).

Assignee: nobody → poirot.alex
Pushed by apoirot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/57ab9d9420d9
[devtools] Add source items in the right position instead of sorting the whole array. r=devtools-reviewers,bomsy
Pushed by apoirot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/db0b34809708
[devtools] Add source items in the right position instead of sorting the whole array. r=devtools-reviewers,bomsy
Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 124 Branch

== Change summary for alert #41492 (as of Thu, 15 Feb 2024 22:57:51 GMT) ==

Regressions:

Ratio Test Platform Options Absolute values (old vs new)
3% damp custom.jsdebugger.pause.DAMP linux1804-64-shippable-qr e10s fission stylo webrender 772.52 -> 795.73

Improvements:

Ratio Test Platform Options Absolute values (old vs new)
8% damp custom.jsdebugger.open.DAMP windows10-64-shippable-qr e10s fission stylo webrender 780.52 -> 721.99
7% damp custom.jsdebugger.open.DAMP windows10-64-shippable-qr e10s fission stylo webrender-sw 782.16 -> 723.71
7% damp custom.jsdebugger.open.DAMP linux1804-64-shippable-qr e10s fission stylo webrender 948.49 -> 877.72
7% damp custom.jsdebugger.pause.DAMP windows10-64-shippable-qr e10s fission stylo webrender-sw 578.56 -> 536.91
7% damp custom.jsdebugger.pause.DAMP windows10-64-shippable-qr e10s fission stylo webrender 577.43 -> 538.45
... ... ... ... ...
5% damp custom.jsdebugger.reload.DAMP windows10-64-shippable-qr e10s fission stylo webrender-sw 845.52 -> 806.94

For up to date results, see: https://treeherder.mozilla.org/perfherder/alerts?id=41492

See Also: → 1880809
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: