DescriptionOptimize SelectorChecker's containsHTMLSpace() utility function
Avoid calling is8Bit() for every character in SelectorChecker's
containsHTMLSpace() by doing the check once at the beginning and then call a
templated containsHTMLSpaceTemplate() for the corresponding character type that
will iterate over the raw string array.
String::operator[] is not ideal here because:
- It checks if the String's StringImpl is non-null
- It does array bound checking
- It calls is8Bit() to access the right raw string array
The new implementation avoids doing these checks for every character in the
string being checked.
I see a 2.5% progression on cssquery-jquery's div[class~=dialog] subtest
(7152.80 -> 7331.60 +/- 0.5%):
http://dromaeo.com/?id=222400,222406
R=esprehn@chromium.org, eseidel@chromium.org
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=175477
Patch Set 1 #Patch Set 2 : Add LIKELY() #Messages
Total messages: 16 (0 generated)
|