Closed Bug 1775203 Opened 2 years ago Closed 2 years ago

Reduce number of state updates related to symbols

Categories

(DevTools :: Debugger, enhancement)

enhancement

Tracking

(firefox104 fixed)

RESOLVED FIXED
104 Branch
Tracking Status
firefox104 --- fixed

People

(Reporter: ochameau, Assigned: ochameau)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

Attachments

(2 files)

For now there is three possible states for symbols of a given source:

  • null
  • { loading: true }
  • { ... populate symbols object ... }

Given that we force fetching the symbols when selecting a source:
https://searchfox.org/mozilla-central/rev/b1a5802e0f73bfd6d2096e5fefc2b47831a50b2d/devtools/client/debugger/src/actions/sources/select.js#191
I think that the intermediate { loading: true } isn't necessary. Instead we could consider that symbols are loading if symbols are null.
This would reducer the number of state changes, reduce the number of calls to mapStateToProps and also avoid unecessary re-rendering of components tied to symbols.

This helps reduce the number of state changes and the number of renders.
We now switch from null symbols which means they are loading,
to an object with the loaded symbols.

Assignee: nobody → poirot.alex
Status: NEW → ASSIGNED

Now that we no longer have the intermediate "loading" object,
we can simplify the code checking for loading symbols by checking
if symbols are defined.

Blocks: 1775252
Pushed by apoirot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1574d614ce48
[devtools] Remove "loading" state of symbols state object. r=bomsy
https://hg.mozilla.org/integration/autoland/rev/485c98c274d3
[devtools] Unify code around getSymbols method. r=bomsy,perftest-reviewers,davehunt
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 104 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: