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

Issue 17583004: Improve WTF::HashTable performance by changing probing method (Closed)

Created:
7 years, 6 months ago by Timothy Loh
Modified:
7 years, 5 months ago
CC:
blink-reviews, loislo+blink_chromium.org, eae+blinkwatch, yurys+blink_chromium.org, adamk+blink_chromium.org, jeez
Base URL:
https://chromium.googlesource.com/chromium/blink@master
Visibility:
Public.

Description

Improve WTF::HashTable performance by changing probing method Our current HashTable implementation uses a linear probing system where the delta is a hash of the given hash, which for integers requires numerous shift and add operations to compute. This patch takes some inspiration from CPython's dict implementation[1] to improve average performance. The new probing system is based off CPython's implementation -- we use a linear congruential generator (x <- x*5+1), but for the first few probes we also mix in the original hash (we shift this right by 5 each probe, so we should use all the bits of the hash if the hash table is at least 32 objects big). [1] http://svn.python.org/projects/python/trunk/Objects/dictobject.c BUG= Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=153057

Patch Set 1 #

Total comments: 1

Patch Set 2 : just probe change #

Patch Set 3 : rebaseline named-grid-line-get-set which depends on hashtable iteration order #

Unified diffs Side-by-side diffs Delta from patch set Stats (+31 lines, -44 lines) Patch
M LayoutTests/fast/css-grid-layout/named-grid-line-get-set.html View 1 2 2 chunks +4 lines, -4 lines 0 comments Download
M LayoutTests/fast/css-grid-layout/named-grid-line-get-set-expected.txt View 1 2 2 chunks +6 lines, -6 lines 0 comments Download
M Source/wtf/HashTable.h View 1 14 chunks +21 lines, -34 lines 0 comments Download

Messages

Total messages: 18 (0 generated)
Timothy Loh
Hi guys, This patch tweaks the WTF::HashTable implementation for performance. I think it should make ...
7 years, 6 months ago (2013-06-24 04:49:36 UTC) #1
abarth-chromium
What machine are you running these perf measurements on? Please be aware that the z620s ...
7 years, 6 months ago (2013-06-24 04:53:06 UTC) #2
abarth-chromium
Also, we can start by focusing on html5-full-render and expand from there to other perf ...
7 years, 6 months ago (2013-06-24 04:57:02 UTC) #3
Timothy Loh
On 2013/06/24 04:53:06, abarth wrote: > What machine are you running these perf measurements on? ...
7 years, 6 months ago (2013-06-24 10:33:38 UTC) #4
abarth-chromium
On 2013/06/24 10:33:38, Timothy Loh wrote: > So it looks like this improves performance on ...
7 years, 6 months ago (2013-06-24 16:55:08 UTC) #5
abarth-chromium
Won't this cause problems for hash tables that actually use integer keys? Maybe I've misunderstood, ...
7 years, 6 months ago (2013-06-25 05:03:38 UTC) #6
Timothy Loh
On 2013/06/25 05:03:38, abarth wrote: > Won't this cause problems for hash tables that actually ...
7 years, 6 months ago (2013-06-25 06:40:08 UTC) #7
abarth-chromium
On 2013/06/25 06:40:08, Timothy Loh wrote: > Here it looks like either or both of ...
7 years, 6 months ago (2013-06-25 08:10:53 UTC) #8
Timothy Loh
On 2013/06/25 08:10:53, abarth wrote: > These classes are extremely widely used throughout the codebase. ...
7 years, 6 months ago (2013-06-26 06:33:26 UTC) #9
abarth-chromium
Sorry, I wasn't clear. I think we should land the changes the probing and see ...
7 years, 6 months ago (2013-06-26 06:40:24 UTC) #10
Timothy Loh
On 2013/06/26 06:40:24, abarth wrote: > Sorry, I wasn't clear. I think we should land ...
7 years, 6 months ago (2013-06-26 06:53:04 UTC) #11
abarth-chromium
lgtm Thanks! Let's see how it goes. :)
7 years, 6 months ago (2013-06-26 07:15:35 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/timloh@chromium.org/17583004/10001
7 years, 6 months ago (2013-06-26 07:15:49 UTC) #13
commit-bot: I haz the power
Retried try job too often on linux_layout_rel for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_layout_rel&number=13972
7 years, 6 months ago (2013-06-26 08:09:09 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/timloh@chromium.org/17583004/10001
7 years, 6 months ago (2013-06-26 08:10:28 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/timloh@chromium.org/17583004/29001
7 years, 6 months ago (2013-06-26 08:36:30 UTC) #16
commit-bot: I haz the power
Change committed as 153057
7 years, 6 months ago (2013-06-26 10:00:51 UTC) #17
Timothy Loh
7 years, 5 months ago (2013-06-27 16:39:06 UTC) #18
Message was sent while issue was closed.
On 2013/06/26 10:00:51, I haz the power (commit-bot) wrote:
> Change committed as 153057

Note: This was reverted, see https://codereview.chromium.org/17996003/

Powered by Google App Engine
This is Rietveld 408576698