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

Issue 23728006: addMarker() optimizations. (Closed)

Created:
7 years, 3 months ago by pstanek
Modified:
7 years, 3 months ago
CC:
blink-reviews, dglazkov+blink, eae+blinkwatch, adamk+blink_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

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 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=158288

Patch Set 1 #

Total comments: 28

Patch Set 2 : Addressing review comments #

Patch Set 3 : Rebase & split marker list by marker type. #

Total comments: 42

Patch Set 4 : More review commments (style, additions: upper/lower bounding where easily possible, creating the l… #

Total comments: 1

Patch Set 5 : Style #

Patch Set 6 : Compilation fix #

Unified diffs Side-by-side diffs Delta from patch set Stats (+255 lines, -174 lines) Patch
M Source/core/dom/DocumentMarker.h View 1 2 3 1 chunk +10 lines, -3 lines 0 comments Download
M Source/core/dom/DocumentMarkerController.h View 1 2 1 chunk +3 lines, -1 line 0 comments Download
M Source/core/dom/DocumentMarkerController.cpp View 1 2 3 4 5 17 chunks +242 lines, -170 lines 0 comments Download

Messages

Total messages: 51 (0 generated)
pstanek
No separate test for this as Interactive\spellcheck-paste-huge-text.html shows some improvement.
7 years, 3 months ago (2013-09-13 16:29:25 UTC) #1
groby-ooo-7-16
Mind sharing the performance improvement numbers? (I think the patch is valuable even without significant ...
7 years, 3 months ago (2013-09-13 18:05:47 UTC) #2
tony
https://codereview.chromium.org/23728006/diff/1/Source/core/dom/DocumentMarkerController.cpp File Source/core/dom/DocumentMarkerController.cpp (right): https://codereview.chromium.org/23728006/diff/1/Source/core/dom/DocumentMarkerController.cpp#newcode136 Source/core/dom/DocumentMarkerController.cpp:136: static bool startsFurther(const DocumentMarker& lhv, const DocumentMarker& rhv) On ...
7 years, 3 months ago (2013-09-13 18:18:49 UTC) #3
pstanek
https://codereview.chromium.org/23728006/diff/1/Source/core/dom/DocumentMarkerController.cpp File Source/core/dom/DocumentMarkerController.cpp (right): https://codereview.chromium.org/23728006/diff/1/Source/core/dom/DocumentMarkerController.cpp#newcode164 Source/core/dom/DocumentMarkerController.cpp:164: if (list->last().endOffset() >= newMarker.startOffset()) { On 2013/09/13 18:05:48, groby ...
7 years, 3 months ago (2013-09-14 08:18:50 UTC) #4
pstanek
On 2013/09/13 18:05:47, groby wrote: > Mind sharing the performance improvement numbers? > > (I ...
7 years, 3 months ago (2013-09-14 08:19:48 UTC) #5
groby-ooo-7-16
https://codereview.chromium.org/23728006/diff/1/Source/core/dom/DocumentMarkerController.cpp File Source/core/dom/DocumentMarkerController.cpp (right): https://codereview.chromium.org/23728006/diff/1/Source/core/dom/DocumentMarkerController.cpp#newcode164 Source/core/dom/DocumentMarkerController.cpp:164: if (list->last().endOffset() >= newMarker.startOffset()) { You probably want '>', ...
7 years, 3 months ago (2013-09-17 02:23:46 UTC) #6
groby-ooo-7-16
https://codereview.chromium.org/23728006/diff/1/Source/core/dom/DocumentMarkerController.cpp File Source/core/dom/DocumentMarkerController.cpp (right): https://codereview.chromium.org/23728006/diff/1/Source/core/dom/DocumentMarkerController.cpp#newcode141 Source/core/dom/DocumentMarkerController.cpp:141: static bool doesNotOverlap(const DocumentMarker& lhv, const DocumentMarker& rhv) I ...
7 years, 3 months ago (2013-09-17 11:52:41 UTC) #7
pstanek
https://codereview.chromium.org/23728006/diff/1/Source/core/dom/DocumentMarkerController.cpp File Source/core/dom/DocumentMarkerController.cpp (right): https://codereview.chromium.org/23728006/diff/1/Source/core/dom/DocumentMarkerController.cpp#newcode141 Source/core/dom/DocumentMarkerController.cpp:141: static bool doesNotOverlap(const DocumentMarker& lhv, const DocumentMarker& rhv) On ...
7 years, 3 months ago (2013-09-17 12:46:29 UTC) #8
pstanek
https://codereview.chromium.org/23728006/diff/1/Source/core/dom/DocumentMarkerController.cpp File Source/core/dom/DocumentMarkerController.cpp (right): https://codereview.chromium.org/23728006/diff/1/Source/core/dom/DocumentMarkerController.cpp#newcode164 Source/core/dom/DocumentMarkerController.cpp:164: if (list->last().endOffset() >= newMarker.startOffset()) { On 2013/09/17 02:23:47, groby ...
7 years, 3 months ago (2013-09-17 13:53:59 UTC) #9
groby-ooo-7-16
Sorry for this long-ish review process :( https://codereview.chromium.org/23728006/diff/1/Source/core/dom/DocumentMarkerController.cpp File Source/core/dom/DocumentMarkerController.cpp (right): https://codereview.chromium.org/23728006/diff/1/Source/core/dom/DocumentMarkerController.cpp#newcode141 Source/core/dom/DocumentMarkerController.cpp:141: static bool ...
7 years, 3 months ago (2013-09-17 14:20:25 UTC) #10
groby-ooo-7-16
https://codereview.chromium.org/23728006/diff/1/Source/core/dom/DocumentMarkerController.cpp File Source/core/dom/DocumentMarkerController.cpp (right): https://codereview.chromium.org/23728006/diff/1/Source/core/dom/DocumentMarkerController.cpp#newcode164 Source/core/dom/DocumentMarkerController.cpp:164: if (list->last().endOffset() >= newMarker.startOffset()) { Sigh. I misread that, ...
7 years, 3 months ago (2013-09-17 14:34:41 UTC) #11
pstanek
https://codereview.chromium.org/23728006/diff/1/Source/core/dom/DocumentMarkerController.cpp File Source/core/dom/DocumentMarkerController.cpp (right): https://codereview.chromium.org/23728006/diff/1/Source/core/dom/DocumentMarkerController.cpp#newcode141 Source/core/dom/DocumentMarkerController.cpp:141: static bool doesNotOverlap(const DocumentMarker& lhv, const DocumentMarker& rhv) But ...
7 years, 3 months ago (2013-09-17 14:48:04 UTC) #12
pstanek
https://codereview.chromium.org/23728006/diff/1/Source/core/dom/DocumentMarkerController.cpp File Source/core/dom/DocumentMarkerController.cpp (right): https://codereview.chromium.org/23728006/diff/1/Source/core/dom/DocumentMarkerController.cpp#newcode184 Source/core/dom/DocumentMarkerController.cpp:184: void DocumentMarkerController::mergeOverlapping(MarkerList* list, DocumentMarker& toInsert) I'll try to combine ...
7 years, 3 months ago (2013-09-17 16:20:37 UTC) #13
pstanek
https://codereview.chromium.org/23728006/diff/1/Source/core/dom/DocumentMarkerController.cpp File Source/core/dom/DocumentMarkerController.cpp (right): https://codereview.chromium.org/23728006/diff/1/Source/core/dom/DocumentMarkerController.cpp#newcode169 Source/core/dom/DocumentMarkerController.cpp:169: if (pos != list->end()) On 2013/09/13 18:05:48, groby wrote: ...
7 years, 3 months ago (2013-09-17 16:57:00 UTC) #14
groby-ooo-7-16
https://codereview.chromium.org/23728006/diff/1/Source/core/dom/DocumentMarkerController.cpp File Source/core/dom/DocumentMarkerController.cpp (right): https://codereview.chromium.org/23728006/diff/1/Source/core/dom/DocumentMarkerController.cpp#newcode141 Source/core/dom/DocumentMarkerController.cpp:141: static bool doesNotOverlap(const DocumentMarker& lhv, const DocumentMarker& rhv) Yes, ...
7 years, 3 months ago (2013-09-17 17:14:08 UTC) #15
pstanek
https://codereview.chromium.org/23728006/diff/1/Source/core/dom/DocumentMarkerController.cpp File Source/core/dom/DocumentMarkerController.cpp (right): https://codereview.chromium.org/23728006/diff/1/Source/core/dom/DocumentMarkerController.cpp#newcode141 Source/core/dom/DocumentMarkerController.cpp:141: static bool doesNotOverlap(const DocumentMarker& lhv, const DocumentMarker& rhv) Ah ...
7 years, 3 months ago (2013-09-17 17:30:40 UTC) #16
pstanek
https://codereview.chromium.org/23728006/diff/1/Source/core/dom/DocumentMarkerController.cpp File Source/core/dom/DocumentMarkerController.cpp (right): https://codereview.chromium.org/23728006/diff/1/Source/core/dom/DocumentMarkerController.cpp#newcode141 Source/core/dom/DocumentMarkerController.cpp:141: static bool doesNotOverlap(const DocumentMarker& lhv, const DocumentMarker& rhv) Then ...
7 years, 3 months ago (2013-09-17 17:39:44 UTC) #17
groby-ooo-7-16
https://codereview.chromium.org/23728006/diff/1/Source/core/dom/DocumentMarkerController.cpp File Source/core/dom/DocumentMarkerController.cpp (right): https://codereview.chromium.org/23728006/diff/1/Source/core/dom/DocumentMarkerController.cpp#newcode141 Source/core/dom/DocumentMarkerController.cpp:141: static bool doesNotOverlap(const DocumentMarker& lhv, const DocumentMarker& rhv) Separating ...
7 years, 3 months ago (2013-09-17 18:39:36 UTC) #18
pstanek
https://codereview.chromium.org/23728006/diff/1/Source/core/dom/DocumentMarkerController.cpp File Source/core/dom/DocumentMarkerController.cpp (right): https://codereview.chromium.org/23728006/diff/1/Source/core/dom/DocumentMarkerController.cpp#newcode141 Source/core/dom/DocumentMarkerController.cpp:141: static bool doesNotOverlap(const DocumentMarker& lhv, const DocumentMarker& rhv) Yes. ...
7 years, 3 months ago (2013-09-18 10:49:45 UTC) #19
groby-ooo-7-16
https://codereview.chromium.org/23728006/diff/1/Source/core/dom/DocumentMarkerController.cpp File Source/core/dom/DocumentMarkerController.cpp (right): https://codereview.chromium.org/23728006/diff/1/Source/core/dom/DocumentMarkerController.cpp#newcode141 Source/core/dom/DocumentMarkerController.cpp:141: static bool doesNotOverlap(const DocumentMarker& lhv, const DocumentMarker& rhv) Postponing ...
7 years, 3 months ago (2013-09-18 18:24:08 UTC) #20
pstanek
I did it a go... On 2013/09/18 18:24:08, groby wrote: > https://codereview.chromium.org/23728006/diff/1/Source/core/dom/DocumentMarkerController.cpp > File Source/core/dom/DocumentMarkerController.cpp ...
7 years, 3 months ago (2013-09-19 13:53:37 UTC) #21
groby-ooo-7-16
This did turn out pretty awesome - thank you! If you'd like to finish this ...
7 years, 3 months ago (2013-09-19 18:17:09 UTC) #22
pstanek
https://codereview.chromium.org/23728006/diff/26001/Source/core/dom/DocumentMarkerController.cpp File Source/core/dom/DocumentMarkerController.cpp (right): https://codereview.chromium.org/23728006/diff/26001/Source/core/dom/DocumentMarkerController.cpp#newcode409 Source/core/dom/DocumentMarkerController.cpp:409: Vector<DocumentMarker*> DocumentMarkerController::markers() On 2013/09/19 18:17:09, groby wrote: > I'm ...
7 years, 3 months ago (2013-09-20 15:07:40 UTC) #23
pstanek
https://codereview.chromium.org/23728006/diff/26001/Source/core/dom/DocumentMarkerController.cpp File Source/core/dom/DocumentMarkerController.cpp (right): https://codereview.chromium.org/23728006/diff/26001/Source/core/dom/DocumentMarkerController.cpp#newcode660 Source/core/dom/DocumentMarkerController.cpp:660: if (marker.endOffset() <= startOffset || marker.type() != DocumentMarker::TextMatch) On ...
7 years, 3 months ago (2013-09-20 15:17:32 UTC) #24
pstanek
On 2013/09/20 15:17:32, pstanek wrote: > https://codereview.chromium.org/23728006/diff/26001/Source/core/dom/DocumentMarkerController.cpp > File Source/core/dom/DocumentMarkerController.cpp (right): > > https://codereview.chromium.org/23728006/diff/26001/Source/core/dom/DocumentMarkerController.cpp#newcode660 > ...
7 years, 3 months ago (2013-09-20 15:22:38 UTC) #25
groby-ooo-7-16
https://codereview.chromium.org/23728006/diff/26001/Source/core/dom/DocumentMarkerController.cpp File Source/core/dom/DocumentMarkerController.cpp (right): https://codereview.chromium.org/23728006/diff/26001/Source/core/dom/DocumentMarkerController.cpp#newcode409 Source/core/dom/DocumentMarkerController.cpp:409: Vector<DocumentMarker*> DocumentMarkerController::markers() A quick code search actually reveals no ...
7 years, 3 months ago (2013-09-20 15:35:58 UTC) #26
pstanek
https://codereview.chromium.org/23728006/diff/26001/Source/core/dom/DocumentMarkerController.cpp File Source/core/dom/DocumentMarkerController.cpp (right): https://codereview.chromium.org/23728006/diff/26001/Source/core/dom/DocumentMarkerController.cpp#newcode609 Source/core/dom/DocumentMarkerController.cpp:609: if (marker.startOffset() >= startOffset) { On 2013/09/19 18:17:09, groby ...
7 years, 3 months ago (2013-09-20 18:55:59 UTC) #27
pstanek
https://codereview.chromium.org/23728006/diff/26001/Source/core/dom/DocumentMarkerController.cpp File Source/core/dom/DocumentMarkerController.cpp (right): https://codereview.chromium.org/23728006/diff/26001/Source/core/dom/DocumentMarkerController.cpp#newcode177 Source/core/dom/DocumentMarkerController.cpp:177: for (size_t markerListIndex = 0; markerListIndex < DocumentMarker::MarkerTypeIndexesCount; ++markerListIndex) ...
7 years, 3 months ago (2013-09-21 21:09:58 UTC) #28
pstanek
https://codereview.chromium.org/23728006/diff/26001/Source/core/dom/DocumentMarker.h File Source/core/dom/DocumentMarker.h (right): https://codereview.chromium.org/23728006/diff/26001/Source/core/dom/DocumentMarker.h#newcode42 Source/core/dom/DocumentMarker.h:42: SpellingMarkerIndex, On 2013/09/19 18:17:09, groby wrote: > Personal nit: ...
7 years, 3 months ago (2013-09-21 21:10:51 UTC) #29
groby-ooo-7-16
LGTM - thank you for doing this work! morrita1, tony, rouslan: PTAL.
7 years, 3 months ago (2013-09-23 17:15:09 UTC) #30
please use gerrit instead
From spellchecking perspective, there seems to be no changes, so lgtm. What are the performance ...
7 years, 3 months ago (2013-09-23 18:56:37 UTC) #31
please use gerrit instead
On 2013/09/14 08:19:48, pstanek wrote: > The TC shows 7-10% improvement here. You should put ...
7 years, 3 months ago (2013-09-23 18:58:24 UTC) #32
tony
I trust groby's review and only checked the style. LGTM. https://codereview.chromium.org/23728006/diff/37001/Source/core/dom/DocumentMarkerController.cpp File Source/core/dom/DocumentMarkerController.cpp (right): https://codereview.chromium.org/23728006/diff/37001/Source/core/dom/DocumentMarkerController.cpp#newcode48 ...
7 years, 3 months ago (2013-09-23 19:34:03 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pstanek@opera.com/23728006/48001
7 years, 3 months ago (2013-09-24 10:31:38 UTC) #34
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
7 years, 3 months ago (2013-09-24 11:03:57 UTC) #35
pstanek
On 2013/09/23 19:34:03, tony wrote: > I trust groby's review and only checked the style. ...
7 years, 3 months ago (2013-09-24 11:31:09 UTC) #36
tony
LGTM. You're right. I was confusing MarkerTypeIndex and MarkerType.
7 years, 3 months ago (2013-09-24 16:46:46 UTC) #37
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pstanek@opera.com/23728006/54001
7 years, 3 months ago (2013-09-24 16:47:12 UTC) #38
commit-bot: I haz the power
Retried try job too often on win_blink_rel for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_blink_rel&number=7067
7 years, 3 months ago (2013-09-24 17:34:15 UTC) #39
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pstanek@opera.com/23728006/54001
7 years, 3 months ago (2013-09-24 17:38:20 UTC) #40
commit-bot: I haz the power
Retried try job too often on win_blink_rel for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_blink_rel&number=7070
7 years, 3 months ago (2013-09-24 17:42:40 UTC) #41
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pstanek@opera.com/23728006/54001
7 years, 3 months ago (2013-09-24 17:45:50 UTC) #42
pstanek
On 2013/09/24 17:42:40, I haz the power (commit-bot) wrote: > Retried try job too often ...
7 years, 3 months ago (2013-09-24 17:45:52 UTC) #43
commit-bot: I haz the power
Retried try job too often on win_blink_rel for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_blink_rel&number=7073
7 years, 3 months ago (2013-09-24 17:50:59 UTC) #44
pstanek
On 2013/09/24 17:50:59, I haz the power (commit-bot) wrote: > Retried try job too often ...
7 years, 3 months ago (2013-09-24 17:57:18 UTC) #45
please use gerrit instead
On 2013/09/24 17:57:18, pstanek wrote: > On 2013/09/24 17:50:59, I haz the power (commit-bot) wrote: ...
7 years, 3 months ago (2013-09-24 17:59:43 UTC) #46
tony
On 2013/09/24 17:57:18, pstanek wrote: > On 2013/09/24 17:50:59, I haz the power (commit-bot) wrote: ...
7 years, 3 months ago (2013-09-24 17:59:48 UTC) #47
pstanek
On 2013/09/24 17:59:48, tony wrote: > On 2013/09/24 17:57:18, pstanek wrote: > > On 2013/09/24 ...
7 years, 3 months ago (2013-09-24 18:00:54 UTC) #48
groby-ooo-7-16
I don't think it's you. Occasionally, the try servers are in a bad mood. If ...
7 years, 3 months ago (2013-09-24 18:02:32 UTC) #49
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pstanek@opera.com/23728006/54001
7 years, 3 months ago (2013-09-25 00:07:36 UTC) #50
commit-bot: I haz the power
7 years, 3 months ago (2013-09-25 01:21:56 UTC) #51
Message was sent while issue was closed.
Change committed as 158288

Powered by Google App Engine
This is Rietveld 408576698