Optimize SpellChecker::GetSpellCheckMarkerUnderSelection()
Currently, this method does a linear scan over all spell check markers contained in the text node(s) containing the selection. This takes about 0.553 ms on the source for the "List of Australian treaties" Wikipedia page. This CL refactors this method to instead use the newly-added DocumentMarkerController::FirstMarkerIntersectingRange() method, which is more efficient as it uses binary search. With this change, we now spend about ~0.02 ms in this method doing the same test. BUG=736181 Review-Url: https://codereview.chromium.org/2947093003 Cr-Commit-Position: refs/heads/master@{#488577}
Showing
Please register or sign in to comment