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

Issue 494993002: HTMLConstructionSite: avoid n^2 running time for large scripts. (Closed)

Created:
6 years, 4 months ago by eustas
Modified:
6 years, 3 months ago
CC:
blink-reviews, dglazkov+blink, blink-reviews-html_chromium.org, abarth-chromium, kouhei (in TOK)
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Project:
blink
Visibility:
Public.

Description

HTMLConstructionSite: avoid n^2 running time for large scripts. Every time background parser sends chunk, tree is flushed. If page contains very large script, then script node content is updated many times. Every update is causes string concatenation. Solution: do not flush pending text until it is mandatory. Test: https://codereview.chromium.org/500363002 Test depends on: https://codereview.chromium.org/544453004/ BUG=410790 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=181635

Patch Set 1 #

Total comments: 2

Patch Set 2 : Add FlushMode enum #

Total comments: 2

Patch Set 3 : #

Total comments: 2

Patch Set 4 : #

Total comments: 1

Patch Set 5 : Fix assert #

Unified diffs Side-by-side diffs Delta from patch set Stats (+30 lines, -16 lines) Patch
M Source/core/html/parser/HTMLConstructionSite.h View 1 2 3 4 2 chunks +12 lines, -4 lines 0 comments Download
M Source/core/html/parser/HTMLConstructionSite.cpp View 1 2 5 chunks +9 lines, -5 lines 0 comments Download
M Source/core/html/parser/HTMLDocumentParser.cpp View 1 2 3 4 2 chunks +4 lines, -3 lines 0 comments Download
M Source/core/html/parser/HTMLTreeBuilder.h View 1 2 3 1 chunk +3 lines, -2 lines 0 comments Download
M Source/core/html/parser/HTMLTreeBuilder.cpp View 1 2 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 31 (8 generated)
eustas
6 years, 4 months ago (2014-08-22 11:06:48 UTC) #1
eseidel
https://codereview.chromium.org/494993002/diff/1/Source/core/html/parser/HTMLConstructionSite.cpp File Source/core/html/parser/HTMLConstructionSite.cpp (right): https://codereview.chromium.org/494993002/diff/1/Source/core/html/parser/HTMLConstructionSite.cpp#newcode695 Source/core/html/parser/HTMLConstructionSite.cpp:695: flushPendingText(true); We'll need to fix this to be an ...
6 years, 4 months ago (2014-08-23 19:39:59 UTC) #2
eseidel
The reason why we added this whole pendingText system was to work around similar N^2 ...
6 years, 4 months ago (2014-08-23 19:43:39 UTC) #3
eustas
On 2014/08/23 19:43:39, eseidel wrote: > The reason why we added this whole pendingText system ...
6 years, 4 months ago (2014-08-26 07:30:37 UTC) #4
eustas
https://codereview.chromium.org/494993002/diff/1/Source/core/html/parser/HTMLConstructionSite.cpp File Source/core/html/parser/HTMLConstructionSite.cpp (right): https://codereview.chromium.org/494993002/diff/1/Source/core/html/parser/HTMLConstructionSite.cpp#newcode695 Source/core/html/parser/HTMLConstructionSite.cpp:695: flushPendingText(true); On 2014/08/23 19:39:59, eseidel wrote: > We'll need ...
6 years, 4 months ago (2014-08-26 08:12:25 UTC) #5
eseidel
https://codereview.chromium.org/494993002/diff/20001/Source/core/html/parser/HTMLConstructionSite.h File Source/core/html/parser/HTMLConstructionSite.h (right): https://codereview.chromium.org/494993002/diff/20001/Source/core/html/parser/HTMLConstructionSite.h#newcode97 Source/core/html/parser/HTMLConstructionSite.h:97: FacultativeFlush, // Do not flush if there is no ...
6 years, 3 months ago (2014-08-26 16:26:39 UTC) #6
eustas
https://codereview.chromium.org/494993002/diff/20001/Source/core/html/parser/HTMLConstructionSite.h File Source/core/html/parser/HTMLConstructionSite.h (right): https://codereview.chromium.org/494993002/diff/20001/Source/core/html/parser/HTMLConstructionSite.h#newcode97 Source/core/html/parser/HTMLConstructionSite.h:97: FacultativeFlush, // Do not flush if there is no ...
6 years, 3 months ago (2014-08-27 11:31:26 UTC) #7
eustas
PTAL
6 years, 3 months ago (2014-08-29 07:37:03 UTC) #8
eseidel
https://codereview.chromium.org/494993002/diff/40001/Source/core/html/parser/HTMLTreeBuilder.h File Source/core/html/parser/HTMLTreeBuilder.h (right): https://codereview.chromium.org/494993002/diff/40001/Source/core/html/parser/HTMLTreeBuilder.h#newcode86 Source/core/html/parser/HTMLTreeBuilder.h:86: void flush() { m_tree.flush(FlushIfAtTextLimit); } What does this mean ...
6 years, 3 months ago (2014-08-29 08:53:09 UTC) #9
eustas
https://codereview.chromium.org/494993002/diff/40001/Source/core/html/parser/HTMLTreeBuilder.h File Source/core/html/parser/HTMLTreeBuilder.h (right): https://codereview.chromium.org/494993002/diff/40001/Source/core/html/parser/HTMLTreeBuilder.h#newcode86 Source/core/html/parser/HTMLTreeBuilder.h:86: void flush() { m_tree.flush(FlushIfAtTextLimit); } On 2014/08/29 08:53:09, eseidel ...
6 years, 3 months ago (2014-09-01 09:46:44 UTC) #10
kouhei (in TOK)
https://codereview.chromium.org/494993002/diff/60001/Source/core/html/parser/HTMLConstructionSite.h File Source/core/html/parser/HTMLConstructionSite.h (right): https://codereview.chromium.org/494993002/diff/60001/Source/core/html/parser/HTMLConstructionSite.h#newcode124 Source/core/html/parser/HTMLConstructionSite.h:124: void flushPendingText(FlushMode); Nit: Can we make this method private? ...
6 years, 3 months ago (2014-09-02 15:56:06 UTC) #12
eustas
On 2014/09/02 15:56:06, kouhei wrote: > https://codereview.chromium.org/494993002/diff/60001/Source/core/html/parser/HTMLConstructionSite.h > File Source/core/html/parser/HTMLConstructionSite.h (right): > > https://codereview.chromium.org/494993002/diff/60001/Source/core/html/parser/HTMLConstructionSite.h#newcode124 > ...
6 years, 3 months ago (2014-09-02 16:04:31 UTC) #13
eseidel
lgtm
6 years, 3 months ago (2014-09-02 17:10:58 UTC) #15
eseidel
Actually, we need *some* kinda of test. Otherwise I'm sure we'll break this again.
6 years, 3 months ago (2014-09-02 17:11:38 UTC) #17
eseidel
Also, please link to a bug.
6 years, 3 months ago (2014-09-02 17:11:51 UTC) #18
eseidel
lgtm Thanks!
6 years, 3 months ago (2014-09-05 17:02:53 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/eustas@chromium.org/494993002/60001
6 years, 3 months ago (2014-09-08 12:04:31 UTC) #21
commit-bot: I haz the power
Try jobs failed on following builders: linux_blink_rel on tryserver.blink (http://build.chromium.org/p/tryserver.blink/builders/linux_blink_rel/builds/23859)
6 years, 3 months ago (2014-09-08 12:38:55 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/eustas@chromium.org/494993002/60001
6 years, 3 months ago (2014-09-09 08:53:12 UTC) #25
commit-bot: I haz the power
Try jobs failed on following builders: linux_blink_rel on tryserver.blink (http://build.chromium.org/p/tryserver.blink/builders/linux_blink_rel/builds/23994)
6 years, 3 months ago (2014-09-09 09:27:42 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/eustas@chromium.org/494993002/80001
6 years, 3 months ago (2014-09-09 10:59:07 UTC) #29
commit-bot: I haz the power
Committed patchset #5 (id:80001) as 181635
6 years, 3 months ago (2014-09-09 11:28:30 UTC) #30
jianli
6 years, 3 months ago (2014-09-09 18:46:30 UTC) #31
Message was sent while issue was closed.
A revert of this CL (patchset #5 id:80001) has been created in
https://codereview.chromium.org/555223002/ by jianli@chromium.org.

The reason for reverting is: Speculative revert.

It may break the following blink sheriff bot:
http://build.chromium.org/p/chromium.webkit/builders/Android%20Tests%20%28dbg...

.

Powered by Google App Engine
This is Rietveld 408576698