Summary: | [WTF] Introduce RobinHoodHashTable | ||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Yusuke Suzuki <ysuzuki> | ||||||||||||||||||||||||||||||||||||||||||||||
Component: | New Bugs | Assignee: | Yusuke Suzuki <ysuzuki> | ||||||||||||||||||||||||||||||||||||||||||||||
Status: | RESOLVED FIXED | ||||||||||||||||||||||||||||||||||||||||||||||||
Severity: | Normal | CC: | aboxhall, annulen, apinheiro, benjamin, cdumez, cfleizach, changseok, cmarcelo, dino, dmazzoni, eric.carlson, esprehn+autocc, ews-watchlist, fmalita, fpizlo, glenn, gyuyoung.kim, jcraig, jdiggs, jer.noble, kangil.han, keith_miller, kondapallykalyan, mark.lam, mifenton, mmaxfield, msaboff, pdr, philipj, ryuan.choi, saam, sabouhallawa, samuel_white, sam, schenney, sergio, tzagallo, webkit-bug-importer | ||||||||||||||||||||||||||||||||||||||||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||||||||||||||||||||||||||||||||||||||||
Version: | WebKit Nightly Build | ||||||||||||||||||||||||||||||||||||||||||||||||
Hardware: | Unspecified | ||||||||||||||||||||||||||||||||||||||||||||||||
OS: | Unspecified | ||||||||||||||||||||||||||||||||||||||||||||||||
Attachments: |
|
Description
Yusuke Suzuki
2021-03-29 13:02:51 PDT
Created attachment 424567 [details]
Patch
Created attachment 424568 [details]
Patch
Created attachment 424583 [details]
Patch
Created attachment 424584 [details]
Patch
Created attachment 424586 [details]
Patch
Created attachment 424599 [details]
Patch
Created attachment 424617 [details]
Patch
Created attachment 424621 [details]
Patch
Created attachment 424623 [details]
Patch
Created attachment 424682 [details]
Patch
Created attachment 424712 [details]
Patch
Created attachment 424750 [details]
Patch
Created attachment 424752 [details]
Patch
Created attachment 424810 [details]
Patch
Created attachment 424874 [details]
Patch
Created attachment 424875 [details]
Patch
Created attachment 424877 [details]
Patch
Created attachment 424882 [details]
Patch
Created attachment 424888 [details]
Patch
Comment on attachment 424888 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=424888&action=review > Source/WTF/wtf/RobinHoodHashTable.h:312 > + while (1) { Maybe while (true) here and elsewhere? Comment on attachment 424888 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=424888&action=review >> Source/WTF/wtf/RobinHoodHashTable.h:312 >> + while (1) { > > Maybe while (true) here and elsewhere? Yeah, fixed :) Created attachment 424950 [details]
Patch
Created attachment 424961 [details]
Patch
Created attachment 424992 [details]
Patch
Committed r275410 (236073@main): <https://commits.webkit.org/236073@main> Committed r275411 (236074@main): <https://commits.webkit.org/236074@main> Comment on attachment 424888 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=424888&action=review Very cool. I think as a follow up we should consider renaming WTF::HashTable to something more evocative of its implementation, since it is now just one of multiple table implementations one can choose. > Source/WTF/ChangeLog:23 > + 1. MemoryCompactLookupOnlyRobinHoodHashSet / HashMap Could we gain even more here by making these perfect hash tables (ala gperf)? > Source/JavaScriptCore/runtime/Identifier.h:297 > + static constexpr bool hasHashInValue = true; I'm not a huge fan of this name, as it reads to me as "has hashInValue" and the use of "value" makes me think that means it is not in the key. Perhaps something like "hashValueStoredInKey"? It would also be good to document this somewhere in HashFunctions.h. https://blog.quarkslab.com/frozen-an-header-only-constexpr-alternative-to-gperf-for-c14-users.html as example of a perfect hash in c++. |