Investigate calls to Array.includes from isInRemovedId and UNSAFE_componentWillUpdate/isOpeningGroup<
Categories
(DevTools :: Console, defect, P2)
Tracking
(firefox123 fixed)
Tracking | Status | |
---|---|---|
firefox123 | --- | fixed |
People
(Reporter: ochameau, Assigned: ochameau)
References
(Blocks 2 open bugs)
Details
Attachments
(1 file, 1 obsolete file)
In bug 1873065 STR, we freeze very frequently, and this seems to mostly involve costly usages of Array.includes.
These usages are only coming from two methods:
These function may be called too frequently and/or manipulating too large objects.
Or we may review a different logic to avoid having to do these computations.
Here is a profiler record bug 1873065 STR:
https://share.firefox.dev/41Pjfkj
Assignee | ||
Comment 1•11 months ago
|
||
A simplier STR:
data:text/html,<script>let r; window.onclick=()=>{if (r) {clearInterval(r)} else r=setInterval(()=>{for(let i=0; i<50; i++){console.log(Math, []); console.trace();}},10);}</script>
This reproduces the amount and type of messages being logged in bug 1873065 STR.
This highlights a serious amount of messages being logged: 10000 per seconds (50 every 10ms - I'm not sure the original STR really follow this pattern):
- 5000 console.log logging an object and an empty array
- 5000 console.trace
Assignee | ||
Comment 2•11 months ago
|
||
The "is in opening group" computation, which goes through all message arrays
can be avoided until it is meaningful to check for this particular edge case.
Also we can remove the redundant check against nextProps.messagesUi
.
Updated•11 months ago
|
Assignee | ||
Comment 3•11 months ago
|
||
As we are only doing inclusion test, and this dataset is often large,
this will be signficantly faster.
Updated•11 months ago
|
Comment 4•10 months ago
|
||
Comment on attachment 9371262 [details]
Bug 1873066 - [devtools] Use a Set (instead of Array) for removed message IDs.
Revision D197771 was moved to bug 1874696. Setting attachment 9371262 [details] to obsolete.
Comment 6•10 months ago
|
||
bugherder |
Description
•