Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[WTF] Use quadratic-probing instead of double-hashing
https://bugs.webkit.org/show_bug.cgi?id=239813 Reviewed by Geoffrey Garen. If table size is always power-of-two, we can safely use quadratic-probing[1] even if the load exceeds 50%. Quadratic-probing and double-hashing have different tradeoff between clustering possibility and CPU cache friendliness. Double-hashing can avoid clustering more, but it is not CPU cache friendly. Quadratic-probing can cause clustering more but better for CPU cache. And while linear-probing caused a lot of trouble and not practical, quadratic-probing with 75% load factor is practical configuration which is used in production-ready hashtables e.g. Google's sparsetable / densetable[2]. This patch replaces WTF::HashTable's probing algorithm from double-hashing to quadratic-probing to make it more cache friendly while keeping reasonable clustering characteristics (compared to linear-probing etc.). Due to this cache friendliness, we get large performance improvements. 1. 0.52% improvement in Speedometer2 with 95% probability. 2. 0.72% improvement in JetStream2 with 98% probability. [1]: https://fgiesen.wordpress.com/2015/02/22/triangular-numbers-mod-2n/ [2]: http://goog-sparsehash.sourceforge.net/doc/implementation.html Canonical link: https://commits.webkit.org/250093@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@293579 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
20c42f5
commit 28e2c3d6e886089048ec5750e15bc1a9db079977
Showing
9 changed files
with
106 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.