Reduce number of state updates related to symbols
Categories
(DevTools :: Debugger, enhancement)
Tracking
(firefox104 fixed)
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.
Assignee | ||
Comment 1•3 years ago
|
||
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.
Updated•3 years ago
|
Assignee | ||
Comment 2•3 years ago
|
||
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.
Comment 4•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/1574d614ce48
https://hg.mozilla.org/mozilla-central/rev/485c98c274d3
Description
•