[Webkit-unassigned] [Bug 190792] topPrivatelyControlledDomain is slow

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Oct 22 13:13:16 PDT 2018


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

--- Comment #16 from Geoffrey Garen <ggaren at apple.com> ---
(In reply to Chris Dumez from comment #15)
> (In reply to Geoffrey Garen from comment #14)
> > (In reply to Antti Koivisto from comment #8)
> > > > Seems very aggressive to clear the whole cache? Why not simply kick one
> > > > value out like we usually do?
> > > 
> > > I tested and it turns out it is a terrible strategy for this sort of thing
> > > at least in the usual 'map.remove(map.begin())' form. Since the table is
> > > never rehashed we always end up removing keys that hash to the early part of
> > > the table and the rest are stuck forever.
> > 
> > Why doesn't the table rehash?
> 
> My understanding is that we only rehash when shrinking / expanding the
> HashTable capacity. In this kind of pattern, we have a max entries (in this
> case 100) so we never need to expand / shrink. We reach 100 entries, remove
> HashTable::begin() then add the new entry.

I see. If we always remove one and add one, then the table never rehashes. Yeah, an explicit idiom to select a random entry would be nice.

-- 
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/20181022/f476ba8f/attachment.html>


More information about the webkit-unassigned mailing list