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

RESOLVED FIXED in mozilla28

Status

()

Core
XPCOM
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: njn, Assigned: njn)

Tracking

unspecified
mozilla28
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [MemShrink])

Attachments

(1 attachment)

(Assignee)

Description

4 years ago
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.
(Assignee)

Comment 1

4 years ago
Created attachment 825031 [details] [diff] [review]
Allow a pldhash to be reasonably overloaded if it cannot be grown further.

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]
(Assignee)

Comment 3

4 years ago
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+
(Assignee)

Comment 5

4 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/542b953e3bff
https://hg.mozilla.org/mozilla-central/rev/542b953e3bff
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
You need to log in before you can comment on or make changes to this bug.