Closed
Bug 1059056
Opened 10 years ago
Closed 10 years ago
Instantiate nsDOMAttributeMap::mAttributeCache lazily
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla34
People
(Reporter: n.nethercote, Assigned: n.nethercote)
References
Details
(Whiteboard: [MemShrink])
Attachments
(1 file)
8.52 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
With Gmail, cnn.com and TechCrunch open, I have 1507 instances of nsDOMAttributeMap::mAttributeCache. 1504 of them are empty, and 3 of them have 1 element. On 64-bit, at 256 bytes a pop, their combined entry storage accounts for 385,792 bytes.
Assignee | ||
Comment 1•10 years ago
|
||
Attachment #8479566 -
Flags: review?(bzbarsky)
Comment 2•10 years ago
|
||
Comment on attachment 8479566 [details] [diff] [review] Instantiate nsDOMAttributeMap::mAttributeCache lazily This works, though we could also do a Maybe<AttrCache>, right? I guess that would still be bigger than a single pointer.... r=me
Attachment #8479566 -
Flags: review?(bzbarsky) → review+
Comment 3•10 years ago
|
||
Just out of idle curiosity, about what % of the empty hash tables you were seeing was this responsible for, Nick?
Assignee | ||
Comment 4•10 years ago
|
||
> Just out of idle curiosity, about what % of the empty hash tables you were
> seeing was this responsible for, Nick?
About 50%.
Comment 6•10 years ago
|
||
Why isn't this using mozilla::UniquePtr instead of nsAutoPtr?
Assignee | ||
Comment 7•10 years ago
|
||
> Why isn't this using mozilla::UniquePtr instead of nsAutoPtr?
I just wanted to give you a chance to ask "Why isn't this using mozilla::UniquePtr instead of nsAutoPtr?"
Comment 8•10 years ago
|
||
And I could ask why should it use mozilla::UniquePtr.
Assignee | ||
Comment 9•10 years ago
|
||
Try looks good: https://tbpl.mozilla.org/?tree=Try&rev=2e7a6d923050
Comment 10•10 years ago
|
||
(In reply to Olli Pettay [:smaug] from comment #8) > And I could ask why should it use mozilla::UniquePtr. Because nsAutoPtr is broken in the same ways std::auto_ptr is broken, in that it can sort-of be copied, and UniquePtr implements correct lack-of-copying semantics and proper move semantics. And also nsAutoPtr is non-standard, whereas UniquePtr emulates the standard std::unique_ptr interface, making it better for approachability/readability/understandability.
Assignee | ||
Comment 11•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/0fe77d7b34fb
Comment 12•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/0fe77d7b34fb
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•