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

Issue 117123003: Inline HashTable::find() methods for performance (Closed)

Created:
6 years, 12 months ago by Inactive
Modified:
6 years, 11 months ago
CC:
blink-reviews, yurys+blink_chromium.org, loislo+blink_chromium.org, adamk+blink_chromium.org, abarth-chromium
Visibility:
Public.

Description

Inline HashTable::find() methods for performance Inline HashTable::find() methods for performance and remove unnecessary null checks for m_table as this check is already done inside HashTable::lookup(). Also move the m_table null-check to the beginning of HashTable::lookup() to avoid unnecessary initialization and hashing when m_table is null. This change improves Bindings/get-element-by-id's score by 8-10% (tested on Linux desktop). This patch is a follow-up to r164029 which replaced a call to HashMap::get() by one to HashMap::find() in DocumentOrderedMap::get(), causing a performance regression in Bindings/get-element-by-id micro benchmark. pprof confirmed that HashTable::find() calls were really hot (26% of the time spent in them). Despite the inlining, the size of the release binary is actually ~54Kb smaller with gcc 4.7, likely because the compiler is able to optimize further (e.g. by removing redundant code). BUG=330778 R=eseidel, cevans Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=164387

Patch Set 1 #

Total comments: 2

Patch Set 2 : Remove other unnecessary null check #

Unified diffs Side-by-side diffs Delta from patch set Stats (+6 lines, -15 lines) Patch
M Source/wtf/HashTable.h View 1 4 chunks +6 lines, -15 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
Inactive
6 years, 12 months ago (2013-12-29 00:23:48 UTC) #1
abarth-chromium
Neat! LGTM
6 years, 11 months ago (2013-12-30 17:27:06 UTC) #2
Chris Evans
Cool. Thanks for not using the blunt hammer of ALWAYS_INLINE :-) LGTM with one nit ...
6 years, 11 months ago (2013-12-30 20:50:54 UTC) #3
Inactive
On 2013/12/30 20:50:54, Chris Evans wrote: > Cool. Thanks for not using the blunt hammer ...
6 years, 11 months ago (2013-12-30 21:14:04 UTC) #4
Inactive
https://codereview.chromium.org/117123003/diff/1/Source/wtf/HashTable.h File Source/wtf/HashTable.h (right): https://codereview.chromium.org/117123003/diff/1/Source/wtf/HashTable.h#newcode823 Source/wtf/HashTable.h:823: return false; On 2013/12/30 20:50:55, Chris Evans wrote: > ...
6 years, 11 months ago (2013-12-30 21:14:14 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ch.dumez@samsung.com/117123003/80001
6 years, 11 months ago (2013-12-30 21:14:45 UTC) #6
commit-bot: I haz the power
6 years, 11 months ago (2013-12-30 22:14:21 UTC) #7
Message was sent while issue was closed.
Change committed as 164387

Powered by Google App Engine
This is Rietveld 408576698