addMarker() optimizations.
Essentially, DocumentMarkerController maintained a list
(WTF::Vector) of markers. And linearly traversed that list
to coalesce markers. If the marker count is large, that's
not optimal.
To improve things the list has been split into couple by the
type of a marker and linear traverse has been replaced with
the binary search (std::lower_bound() & std::upper_bound()).
Also traversing is not performed if not needed. After this
PerformanceTests/Interactive/spellcheck-paste-huge-text.html
shows 7-12% improvement.
BUG=279293
Review URL: https://chromiumcodereview.appspot.com/23728006
git-svn-id: svn://svn.chromium.org/blink/trunk@158288 bbb929c8-8fbe-4397-9dbb-9b2b20218538
3 files changed