Use mutable maps in sources reducer
Categories
(DevTools :: Debugger, enhancement)
Tracking
(firefox114 fixed)
Tracking | Status | |
---|---|---|
firefox114 | --- | fixed |
People
(Reporter: ochameau, Assigned: ochameau)
References
Details
Attachments
(3 files, 1 obsolete file)
Work on bug 1822301 highlights that many maps in sources reducers are cloned on each state change for no good reason.
We could probably improve performance by using mutable maps and simplify a few things by storing source/source actor objects instead of their IDs.
Assignee | ||
Comment 1•2 years ago
|
||
This map is only used for removeThread action and we never return the
content of this map as-is. So we can use mutable data here.
For the map and the array values.
Assignee | ||
Comment 2•2 years ago
|
||
We were never returning list of source IDs as-is.
We are only returning the first source in the array,
or lookup for a precise one.
So we can use a mutable Map and also use mutable array as values.
Also, we could store source objects instead of IDs in order to
prevent doing lots of ID to source lookups.
Source objects are immutable so it is safe storing them.
Assignee | ||
Comment 3•2 years ago
|
||
Instead of storing a subset of attributes, it would drastically simplify things
to store the source actors objects. These objects are immutable so it is safe
to store them into the reducer.
It will prevent having to do many ID to object lookup!
Assignee | ||
Comment 4•2 years ago
|
||
We never return the map as result of a selector,
but we returns map's values.
So ensure still cloning array values everytime we register
a new source actor.
Comment 5•2 years ago
|
||
Comment on attachment 9328833 [details]
Bug 1827909 - [devtools] Store source actor objects in sources reducer's actors map.
Revision D175642 was moved to bug 1822301. Setting attachment 9328833 [details] to obsolete.
Comment 7•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/cc09f130b8b2
https://hg.mozilla.org/mozilla-central/rev/e60f901934f3
https://hg.mozilla.org/mozilla-central/rev/c69b5c3323bf
Description
•