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

Issue 72743002: Optimization in handleStyleSpans() for restricting the for loop to iterate only (Closed)

Created:
7 years, 1 month ago by arpitab_
Modified:
7 years ago
CC:
blink-reviews, editing-bugs_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Optimization in handleStyleSpans() for restricting the for loop to iterate only over the InsertedNodes (i.e. the inserted fragment). This is in line with other methods such as removeRedundantStylesAndKeepStyleSpanInline() and makeInsertedContentRoundTrippableWithHTMLTreeBuilder() that iterate over the InsertedNodes. No existing test should fail with this patch. Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=162740

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2 lines, -1 line) Patch
M Source/core/editing/ReplaceSelectionCommand.cpp View 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 17 (0 generated)
arpitab_
7 years, 1 month ago (2013-11-14 14:43:56 UTC) #1
yosin_UTC9
ACK Thanks for finding this. How about moving this to member function of InsertedNodes? It ...
7 years, 1 month ago (2013-11-15 01:31:58 UTC) #2
yosin_UTC9
BTW, it is better to remove isLegacyAppleStyle(). I filed it as http://crbug.com/319594. We may want ...
7 years, 1 month ago (2013-11-15 01:50:16 UTC) #3
arpitab_
On 2013/11/15 01:50:16, Yoshi wrote: > BTW, it is better to remove isLegacyAppleStyle(). I filed ...
7 years, 1 month ago (2013-11-15 05:38:28 UTC) #4
arpitab_
On 2013/11/15 01:31:58, Yoshi wrote: > ACK > > Thanks for finding this. > How ...
7 years, 1 month ago (2013-11-15 07:25:13 UTC) #5
yosin_UTC9
> Did you mean to have something like this here?: > for (Node* node = ...
7 years, 1 month ago (2013-11-15 07:49:34 UTC) #6
arpitab_
On 2013/11/15 07:49:34, Yoshi wrote: > > Did you mean to have something like this ...
7 years, 1 month ago (2013-11-15 14:10:46 UTC) #7
yosin_UTC9
On 2013/11/15 14:10:46, arpitab_ wrote: > On 2013/11/15 07:49:34, Yoshi wrote: > > > Did ...
7 years, 1 month ago (2013-11-18 01:21:28 UTC) #8
arpitab_
On 2013/11/18 01:21:28, Yoshi wrote: > On 2013/11/15 14:10:46, arpitab_ wrote: > > On 2013/11/15 ...
7 years, 1 month ago (2013-11-18 10:07:28 UTC) #9
yosin_UTC9
ACK
7 years, 1 month ago (2013-11-19 06:29:20 UTC) #10
leviw_travelin_and_unemployed
Did this come up in a profile? How about a perf test that shows that ...
7 years ago (2013-11-26 23:50:57 UTC) #11
yosin_UTC9
On 2013/11/26 23:50:57, Levi wrote: > Did this come up in a profile? How about ...
7 years ago (2013-11-27 01:09:15 UTC) #12
yosin_UTC9
On 2013/11/27 01:09:15, Yoshi wrote: > On 2013/11/26 23:50:57, Levi wrote: > > Did this ...
7 years ago (2013-11-27 01:09:51 UTC) #13
leviw_travelin_and_unemployed
On 2013/11/27 01:09:51, Yoshi wrote: > On 2013/11/27 01:09:15, Yoshi wrote: > > On 2013/11/26 ...
7 years ago (2013-11-27 01:56:10 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/a.bah@samsung.com/72743002/1
7 years ago (2013-11-27 01:56:39 UTC) #15
commit-bot: I haz the power
Change committed as 162740
7 years ago (2013-11-27 09:41:22 UTC) #16
arpitab_
7 years ago (2013-11-27 11:58:20 UTC) #17
Message was sent while issue was closed.
On 2013/11/27 01:56:10, Levi wrote:
> On 2013/11/27 01:09:51, Yoshi wrote:
> > On 2013/11/27 01:09:15, Yoshi wrote:
> > > On 2013/11/26 23:50:57, Levi wrote:
> > > > Did this come up in a profile? How about a perf test that shows that
this
> is
> > a
> > > > win?
> > > 
> > > It seems this is following the pattern to others. Other two loops
remembers
> > > pastEndNode before for-loop. So, each iteration reduce time for calling
> > > NodeTraversal::next() + Node::lastDescendant().
> > 
> > How about changing description to remove the word "Optimization"?
> 
> If it doesn't change behavior but does change performance, I'd say
optimization
> is an accurate description.
> 
> In general we should always try and include a perf test with this sort of
> change, particularly if it hasn't shown up as a performance issue in any real
> world sites. LGTM on this patch for the fact that it's consistent with the
other
> similar loops in ReplaceSelectionCommand.

Thanks for the review Levi, Yoshi.
I'll def try to include perf tests for similar patches in the future.

Powered by Google App Engine
This is Rietveld 408576698