Open
Bug 1558351
Opened 5 years ago
Updated 2 years ago
ES6 Map usage in Network panels' redux state add overhead
Categories
(DevTools :: Netmonitor, task, P3)
DevTools
Netmonitor
Tracking
(Not tracked)
NEW
People
(Reporter: Harald, Unassigned)
References
(Blocks 2 open bugs)
Details
The sweet spot for Map/Set is mutability. For immutable use cases like redux they are not well optimized. They also add GC/CC overhead as they are not handled by the nursery.
Updated•5 years ago
|
Blocks: netmonitor-perf
Comment 1•5 years ago
|
||
Type: defect → task
Comment 2•5 years ago
|
||
Objects are very aggressively optimized because everything relies on objects being fast.
They're especially tuned for these cases:
- creating many objects with the same keys, especially some fixed smallish number of keys (e.g. many instances of a class; object literals; same-shaped objects created by JSON.parse)
- property reads and writes using the syntax
obj.prop
, where the field nameprop
is right there in the source code, so we know it won't change - array-like usage, with small nonnegative integers as the keys
Maps aren't really optimized. They're sometimes more convenient to hack with than objects. They don't need to be much worse than objects when you don't have any of the cases above, i.e. the data you're storing, and your data access patterns, are at least a little random. Or you have a lot of data. But we haven't tried very hard.
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•