Last Comment Bug 697931 - Remove KidHashes when possible
: Remove KidHashes when possible
Status: RESOLVED FIXED
[MemShrink]
:
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: x86_64 Linux
: -- normal (vote)
: mozilla10
Assigned To: Nicholas Nethercote [:njn]
:
: Jason Orendorff [:jorendorff]
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-10-27 21:06 PDT by Nicholas Nethercote [:njn]
Modified: 2011-11-02 23:04 PDT (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch (4.12 KB, patch)
2011-10-27 21:06 PDT, Nicholas Nethercote [:njn]
luke: review+
Details | Diff | Splinter Review

Description Nicholas Nethercote [:njn] 2011-10-27 21:06:27 PDT
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.
Comment 1 Luke Wagner [:luke] 2011-10-27 21:13:01 PDT
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.
Comment 2 Nicholas Nethercote [:njn] 2011-10-27 23:12:05 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/127d6851a322
Comment 3 Matt Brubeck (:mbrubeck) 2011-10-28 12:21:11 PDT
https://hg.mozilla.org/mozilla-central/rev/127d6851a322
Comment 4 Brendan Eich [:brendan] 2011-11-02 23:04:09 PDT
Thanks, njn -- I should have caught this transition and covered it in the landing last summer.

/be

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