about:memory report formatting is slow
Categories
(Toolkit :: about:memory, enhancement)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox66 | --- | fixed |
People
(Reporter: heycam, Assigned: heycam)
Details
Attachments
(1 file)
| Assignee | ||
Comment 1•7 years ago
|
||
| Assignee | ||
Comment 2•7 years ago
|
||
Comment 3•7 years ago
|
||
Comment 5•7 years ago
|
||
| bugherder | ||
Comment 6•7 years ago
|
||
Comment 7•7 years ago
|
||
toLocaleString will recompute/recreate an ICU formatting object every time you call it. The intended way users are expected to adapt to that, is to create a formatting object once, then use that repeatedly. We could perhaps add caching or something for commonly-specified sets of options, or a one-element LRU cache, or similar, but that would slow down every user for the few that don't realize they should be creating a formatter object.
But it looks near-trivial to make this use formatter objects instead of toLocaleString, so we should just do that. I'll file a bug to do that, with an untested patch I've just churned out locally that hopefully someone else can push over the line.
Comment 8•7 years ago
|
||
Filed bug 1518263 to use formatter objects for this. The way formatNum is used here is exactly amenable to using cached formatter objects.
Description
•