Optimize bit access for hot code path in IsHTMLElement()
The [1] CL combined the ElementNamespaceType bits, to save space. However, as seen in [2], this caused a performance regression, likely due to a slower IsHTMLElement(). This CL attempts to get back that performance through two optimizations: - ALWAYS_INLINE the accessors for both GetElementNamespaceType() and the IsXyzElement() accessors. - Move kHTML to a value of 0, in the hope that this operation is faster when the kConstant is zero: GetElementNamespaceType() == kConstant [1] https://chromium.googlesource.com/chromium/src/+/956931765e5969c44ad9a4641ff1c99977c8498f [2] https://crbug.com/1036543 Bug: 1036543 Change-Id: I4976829ab0b7c9d875d4d4e6b516333b44e7dddb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2029311 Commit-Queue: Kent Tamura <tkent@chromium.org> Auto-Submit: Mason Freed <masonfreed@chromium.org> Reviewed-by:Kent Tamura <tkent@chromium.org> Cr-Commit-Position: refs/heads/master@{#737181}
Showing
Please register or sign in to comment