DescriptionInline 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 #Messages
Total messages: 7 (0 generated)
|