Closed Bug 933074 Opened 11 years ago Closed 11 years ago

Allow a pldhash to be reasonably overloaded if it cannot be grown further.

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla28

People

(Reporter: n.nethercote, Assigned: n.nethercote)

Details

(Whiteboard: [MemShrink])

Attachments

(1 file)

It used to be that case that pldhash would allow tables to be overloaded to
100% full if they could not be grown further.  In bug 927705 I changed that so
that 75% full became a hard limit.

Then bug 932781 hit, where pldhash growth failures were causing CC to not
complete and shutdown leaks to occur on Win7 Mochi-2 tests.  The underlying
caused turned out to be something else (badly written tests, primarily) but it
got me thinking... it is reasonable to allow overloading on failure-to-grow, so
long as you don't go all the way to 100%, because then performance truly
plummets.
This patch allows a pldhash to be overloaded up to 96.875% full if it cannot be
grown.  It makes the fill-to-failure test in TestPLDHash.cpp take about 1.4x
longer, which isn't too bad given that it allows 1.3x more elements.
Attachment #825031 - Flags: review?(jorendorff)
Marking as MemShrink because it will make the CC fall over less often.
Whiteboard: [MemShrink]
BTW, I tried a bunch of different N values in the |size - (size >> N)| value and N=5 gave good results -- much beyond that didn't seem worthwhile.
Comment on attachment 825031 [details] [diff] [review]
Allow a pldhash to be reasonably overloaded if it cannot be grown further.

Review of attachment 825031 [details] [diff] [review]:
-----------------------------------------------------------------

Nice.
Attachment #825031 - Flags: review?(jorendorff) → review+
https://hg.mozilla.org/mozilla-central/rev/542b953e3bff
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: