Optimize 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 Review URL: https://codereview.chromium.org/307333004 git-svn-id: svn://svn.chromium.org/blink/trunk@175477 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Showing
Please register or sign in to comment