Closed Bug 1701490 Opened 3 years ago Closed 2 years ago

MBT Console performance issue: 50s to open, 1.8 GB consumed (with profile) - too much time spent in Map construction and Array.from

Categories

(DevTools :: General, defect, P3)

defect

Tracking

(Fission Milestone:Future)

RESOLVED DUPLICATE of bug 1764501
Fission Milestone Future

People

(Reporter: jdescottes, Unassigned)

References

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

Details

On a recently restarted Nightly (my usual profile, but I don't use many addons) with ~30 tabs opened, MBT took almost a minute to open, consuming a lot of memory.

Profile
https://share.firefox.dev/31xm5vT

It seems that most of the time is spent in the console dealing with incoming messages. The 10000 message limit is quickly reached (at least according to the markers) but the console frontend still struggled to process the messages.

Note that content messages were disabled.

Clearing the console significantly improved the issue. I guess there must have been a lot of cached messages, overwhelming the UI.

Blocks: 1625937
Severity: -- → S3
Flags: needinfo?(nchevobbe)
Priority: -- → P3

The profile from Comment 0 shows a high percent of the time is spent in Map constructor and Array.from
This is probably due to the fact that console messages are stored in Map , and operations that we do in message reducers (cloning, re-ordering within the Map, searching) are taking way to long.

A potential solution is to use a simple object to store the messages, as the key of the Map is a simple string.
Since we need to know the order of messages, and given that objects can't guarantee that, we might add another array in the store that would store all the messages ids (same as we already do for storing visible messages).

Flags: needinfo?(nchevobbe)
Summary: MBT performance issue: 50s to open, 1.8 GB consumed (with profile) → MBT Console performance issue: 50s to open, 1.8 GB consumed (with profile) - too much time spent in Map construction and Array.from
Fission Milestone: --- → Future

Bug 1432343 probably helped reduce the time spent in Map constructor
Not sure if we should keep this bug open since we also have Bug 1685081 and Bug 1764501

Depends on: 1432343

Marking as dupe of Bug 1764501

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.