Closed Bug 697931 Opened 8 years ago Closed 8 years ago

Remove KidHashes when possible

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla10

People

(Reporter: njn, Assigned: njn)

Details

(Whiteboard: [MemShrink])

Attachments

(1 file)

Attached patch patchSplinter Review
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)
Whiteboard: [MemShrink]
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+
https://hg.mozilla.org/mozilla-central/rev/127d6851a322
Status: ASSIGNED → RESOLVED
Closed: 8 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.