Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(641)

Issue 2922623002: Make DocumentMarkerListEditor::RemoveMarkers() more efficient (Closed)

Created:
3 years, 6 months ago by rlanday
Modified:
3 years, 6 months ago
Reviewers:
yosin_UTC9, Xiaocheng
CC:
blink-reviews, chromium-reviews
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Make DocumentMarkerListEditor::RemoveMarkers() more efficient The current implementation of this method does a binary search to get the first marker to be removed, then linearly walks the markers, erasing all that fall in the specified range. This can potentially take time quadratic in the number of markers to be removed, and always takes at least log N time. This new implementation finds both the start point and end point of the range to be erased in log N time, then does a single erase operation that takes time linear in the number of markers to be removed. So the asymptotic lower bound stays the same and the asymptotic upper bound is improved from quadratic to linear. I've also added a few more test cases to DocumentMarkerListEditor test to verify the new implementation works correctly. BUG=707867 Review-Url: https://codereview.chromium.org/2922623002 Cr-Commit-Position: refs/heads/master@{#476551} Committed: https://chromium.googlesource.com/chromium/src/+/38610ad5a07527b89be3116610c2c3bff822d5e8

Patch Set 1 #

Total comments: 1

Patch Set 2 : Remove blank line #

Unified diffs Side-by-side diffs Delta from patch set Stats (+41 lines, -15 lines) Patch
M third_party/WebKit/Source/core/editing/markers/DocumentMarkerListEditor.cpp View 1 1 chunk +7 lines, -15 lines 0 comments Download
M third_party/WebKit/Source/core/editing/markers/DocumentMarkerListEditorTest.cpp View 1 chunk +34 lines, -0 lines 0 comments Download

Messages

Total messages: 17 (10 generated)
rlanday
3 years, 6 months ago (2017-06-02 01:03:54 UTC) #2
yosin_UTC9
lgtm https://codereview.chromium.org/2922623002/diff/1/third_party/WebKit/Source/core/editing/markers/DocumentMarkerListEditor.cpp File third_party/WebKit/Source/core/editing/markers/DocumentMarkerListEditor.cpp (right): https://codereview.chromium.org/2922623002/diff/1/third_party/WebKit/Source/core/editing/markers/DocumentMarkerListEditor.cpp#newcode59 third_party/WebKit/Source/core/editing/markers/DocumentMarkerListEditor.cpp:59: nit: Please remove an extra blank line.
3 years, 6 months ago (2017-06-02 01:11:45 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2922623002/1
3 years, 6 months ago (2017-06-02 01:12:40 UTC) #9
rlanday
Woah woah woah, let me fix the nit first :)
3 years, 6 months ago (2017-06-02 01:13:37 UTC) #10
yosin_UTC9
On 2017/06/02 at 01:13:37, rlanday wrote: > Woah woah woah, let me fix the nit ...
3 years, 6 months ago (2017-06-02 01:15:26 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2922623002/20001
3 years, 6 months ago (2017-06-02 01:24:18 UTC) #14
commit-bot: I haz the power
3 years, 6 months ago (2017-06-02 03:26:24 UTC) #17
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as
https://chromium.googlesource.com/chromium/src/+/38610ad5a07527b89be3116610c2...

Powered by Google App Engine
This is Rietveld 408576698