The default bug view has changed. See this FAQ.

Remove KidHashes when possible

RESOLVED FIXED in mozilla10

Status

()

Core
JavaScript Engine
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: njn, Assigned: njn)

Tracking

unspecified
mozilla10
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [MemShrink])

Attachments

(1 attachment)

(Assignee)

Description

6 years ago
Created attachment 570177 [details] [diff] [review]
patch

Looking at Gmail and TechCrunch I see that 13% of all KidHashes contain 0 or
1 elements.  (If you weight KidHashes by their capacity, it's about 10% of
the space used by KidsHash entries.)  This can happen because
Shape::removeChild() does not convert HASH form KidsPointers back to SHAPE
form when possible.

This patch implements the conversion.  This saves roughly 30--40KB for a
page like Gmail.  It also adds capacity() to Hash{Table,Map,Set}, which
aren't used in the patch but I used them for measurement and they seem like
useful additions in general.
Attachment #570177 - Flags: review?(luke)
(Assignee)

Updated

6 years ago
Whiteboard: [MemShrink]

Comment 1

6 years ago
Comment on attachment 570177 [details] [diff] [review]
patch

Looks reasonable.  I was initially worried about thrashing back 'n forth but then I remembered that Shape::removeChild is only called from GC.
Attachment #570177 - Flags: review?(luke) → review+
(Assignee)

Comment 2

6 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/127d6851a322
https://hg.mozilla.org/mozilla-central/rev/127d6851a322
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla10
Thanks, njn -- I should have caught this transition and covered it in the landing last summer.

/be
You need to log in before you can comment on or make changes to this bug.