Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Issue 2034883002: Shrink weak hash tables when adding elements, if needed. (Closed)

Created:
4 years, 6 months ago by sof
Modified:
4 years, 6 months ago
Reviewers:
haraken, tkent
CC:
chromium-reviews, blink-reviews, blink-reviews-wtf_chromium.org, Mikhail
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Shrink weak hash tables when adding elements, if needed. Hash tables containing weak references tend to be asymmetrically handled -- Blink "user code" will add elements to the hash table, with the garbage collector taking care of removing references to elements that have no other strong references to keep them alive. The weak processing of hash tables isn't capable of shrinking and allocate a new hash table backing store while running, hence the table entries are only cleared. Blink code will rarely do manual removals from these collections, which gives the hash table no opportunity to actually shrink the capacity of the backing store. This can lead to hash tables with a very low load factor, the majority of the entries be deleted and empty slots. To allow for shrinking to happen over hash tables with weak references, add() will check if shrinking is required. R= BUG= Committed: https://crrev.com/c9eb1766e3fa7c5b221ceca2c30ca402bb204014 Cr-Commit-Position: refs/heads/master@{#397667}

Patch Set 1 #

Total comments: 4

Patch Set 2 : comment typo #

Unified diffs Side-by-side diffs Delta from patch set Stats (+16 lines, -1 line) Patch
M third_party/WebKit/Source/wtf/HashTable.h View 1 1 chunk +16 lines, -1 line 0 comments Download

Messages

Total messages: 13 (5 generated)
sof
please take a look.
4 years, 6 months ago (2016-06-03 05:27:12 UTC) #3
haraken
https://codereview.chromium.org/2034883002/diff/1/third_party/WebKit/Source/wtf/HashTable.h File third_party/WebKit/Source/wtf/HashTable.h (right): https://codereview.chromium.org/2034883002/diff/1/third_party/WebKit/Source/wtf/HashTable.h#newcode863 third_party/WebKit/Source/wtf/HashTable.h:863: // table entries cleared. But no shrinking of the ...
4 years, 6 months ago (2016-06-03 05:38:10 UTC) #4
sof
https://codereview.chromium.org/2034883002/diff/1/third_party/WebKit/Source/wtf/HashTable.h File third_party/WebKit/Source/wtf/HashTable.h (right): https://codereview.chromium.org/2034883002/diff/1/third_party/WebKit/Source/wtf/HashTable.h#newcode873 third_party/WebKit/Source/wtf/HashTable.h:873: entry = rehash(m_tableSize / 2, entry); On 2016/06/03 05:38:10, ...
4 years, 6 months ago (2016-06-03 05:42:28 UTC) #5
haraken
LGTM
4 years, 6 months ago (2016-06-03 05:46:24 UTC) #6
sof
Will watch for perf fallout; not having tables with abnormal load factors is what we ...
4 years, 6 months ago (2016-06-03 06:17:37 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2034883002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2034883002/20001
4 years, 6 months ago (2016-06-03 08:10:43 UTC) #9
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 6 months ago (2016-06-03 08:45:14 UTC) #11
commit-bot: I haz the power
4 years, 6 months ago (2016-06-03 08:47:48 UTC) #13
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/c9eb1766e3fa7c5b221ceca2c30ca402bb204014
Cr-Commit-Position: refs/heads/master@{#397667}

Powered by Google App Engine
This is Rietveld 408576698