[Webkit-unassigned] [Bug 196681] HashTable::removeIf always shrinks the hash table by half even if there is nothing left

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Apr 6 17:22:35 PDT 2019


https://bugs.webkit.org/show_bug.cgi?id=196681

--- Comment #1 from Ryosuke Niwa <rniwa at webkit.org> ---
HashTable::removeIf has the code like this:

if (shouldShrink())
    shrink();

But shrink does:

void shrink() { rehash(m_tableSize / 2, nullptr); }

Let's say we removed 30 out of 32 entires in the hash table. Then m_tableSize might have been 64 but we'd only shrink the table to 16 after the removal instead of the minimal table size of 8.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190407/1c2570af/attachment.html>


More information about the webkit-unassigned mailing list