|
|
Chromium Code Reviews|
Created:
4 years, 6 months ago by Charlie Harrison Modified:
4 years, 4 months ago Reviewers:
kouhei (in TOK) CC:
blink-reviews, blink-reviews-html_chromium.org, chromium-reviews, dglazkov+blink, kinuko+watch Base URL:
https://chromium.googlesource.com/chromium/src.git@master Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionParseHTMLOnMainThread: notify main thread of chunks less frequently
This patch adds an experiment variant to the
ParseHTMLOnMainThread experiment threaded group. It adds
a group that uses the threaded parser, but coalesces token
chunks in the background parser, notifying the main thread
less often. This can often result in issuing preloads faster
due to not eagerly parsing/scripting when tokens are about to
come in.
Note: this experiment group actually aligns the threaded behavior
closer to the non-threaded behavior. The non-threaded experiment
group also runs the entirety of pumpTokenizer when it is tokenizing,
whereas the threaded parser usually starts parsing at the first call to
notifyPendingTokenizedChunks (if it is idle). This is usually very early
on in pumpTokenizer, because we split up chunks very fine grained.
This experiment group tries not to start the main thread parsing until
we've tokenized a bit more.
TBR=kinuko@chromium.org
BUG=632394
Committed: https://crrev.com/803fb39346006820c009f206dc05dd62b12e82ee
Cr-Commit-Position: refs/heads/master@{#408537}
Patch Set 1 #Patch Set 2 : only do it for the first set of chunks #Patch Set 3 : Add a setting to the experiment #
Messages
Total messages: 32 (17 generated)
csharrison@chromium.org changed reviewers: + kouhei@chromium.org
Kouhei, can you take a look at this approach? It may be a bit too extreme.
Thanks for working on this! This is a great find! I'm ok with trying this experiment, but I want more data on this so that you can maximize your impact from this work :) Can we Finch this? Would you provide traces of demonstrative page load w/+w/o the patch? Would you run PCv2/wptorg?
On 2016/06/15 at 07:09:03, kouhei wrote: > Thanks for working on this! This is a great find! > I'm ok with trying this experiment, but I want more data on this so that you can maximize your impact from this work :) > Can we Finch this? Would you provide traces of demonstrative page load w/+w/o the patch? Would you run PCv2/wptorg? I wonder if we should finch this in isolation or in conjunction with the changes to documentElementAvailable? Now that we know that the documentElementAvailable can cause regressions in some artificial pages (http://stevesouders.com/cuzillion/?c0=hb0hfff0_2_f&c1=hc1hfff2_0_f&c2=hc1hfff...), it may make sense to finch it. Especially considering that this change which fixes that site is a bit more extreme than the original change. WDYT?
I wonder if we can rework this so it doesn't need finch? I'm noticing a lot of sites hitting this case (first chunks don't have preloads). I know there have been a lot of hacks added, but I'd like to find a reasonable solution for the first set of preloads. If we could just defer notifying the main thread for 25-50 tokens, I think it would drastically improve a lot of pages (for users with extensions). On my workstation with a few active extensions, I'm seeing 70ms delays that could be cut down to 0.
The CQ bit was checked by csharrison@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Ok. I reworked this so that we only change the initial call to pumpTokenizer. This is where I see idle network the most in traces.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Note that this doesn't really affect the ParseHTMLOnMainThread experiment as it currently stands, because we never quit the while loop if it is running on the main thread (i.e. we always tokenize to the end before starting to parse). Still, I think this is worthwhile and is very low hanging fruit for a lot of sites.
Sorry, I've changed my mind again on this, and think we should go back to PS #1. Too often the first call to notify the main thread has no preloads, and we don't actually initialize the preloads for a long time.
I have no objections to PS#1 approach, but I really want to have some gating before we land this optimization. Can we default-enable this, but have some population disable this so that we can compare them?
Yeah SG.
The CQ bit was checked by csharrison@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== Notify the main thread of parsed chunks less frequently BUG= ========== to ========== Notify the main thread of parsed chunks less frequently This patch adds an experiment variant to the ParseHTMLOnMainThread experiment threaded group. It adds a group that uses the threaded parser, but coalesces token chunks in the background parser, notifying the main thread less often. This can often result in issuing preloads faster due to not eagerly parsing/scripting when tokens are about to come in. BUG=632394 ==========
Description was changed from ========== Notify the main thread of parsed chunks less frequently This patch adds an experiment variant to the ParseHTMLOnMainThread experiment threaded group. It adds a group that uses the threaded parser, but coalesces token chunks in the background parser, notifying the main thread less often. This can often result in issuing preloads faster due to not eagerly parsing/scripting when tokens are about to come in. BUG=632394 ========== to ========== Notify the main thread of parsed chunks less frequently This patch adds an experiment variant to the ParseHTMLOnMainThread experiment threaded group. It adds a group that uses the threaded parser, but coalesces token chunks in the background parser, notifying the main thread less often. This can often result in issuing preloads faster due to not eagerly parsing/scripting when tokens are about to come in. TBR=kinuko@chromium.org BUG=632394 ==========
Alright, I decided to add this group to the ParseHTMLOnMainThread experiment (for the threaded group). PTAL? I will also try to get this merged into M53 if all goes well. +kinuko TBR for comment in //content.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
On 2016/07/28 17:08:17, csharrison wrote: > Alright, I decided to add this group to the ParseHTMLOnMainThread experiment > (for the threaded group). PTAL? lgtm
Description was changed from ========== Notify the main thread of parsed chunks less frequently This patch adds an experiment variant to the ParseHTMLOnMainThread experiment threaded group. It adds a group that uses the threaded parser, but coalesces token chunks in the background parser, notifying the main thread less often. This can often result in issuing preloads faster due to not eagerly parsing/scripting when tokens are about to come in. TBR=kinuko@chromium.org BUG=632394 ========== to ========== Notify the main thread of parsed chunks less frequently This patch adds an experiment variant to the ParseHTMLOnMainThread experiment threaded group. It adds a group that uses the threaded parser, but coalesces token chunks in the background parser, notifying the main thread less often. This can often result in issuing preloads faster due to not eagerly parsing/scripting when tokens are about to come in. Note: this experiment group actually aligns the threaded behavior closer to the non-threaded behavior. The non-threaded experiment group has also runs the entirety of pumpTokenizer when it is tokenizing, whereas the threaded parser usually starts parsing at the first call to notifyPendingTokenizedChunks (if it is idle). This experiment group tries not to start the main thread parsing until we've tokenized a bit more. TBR=kinuko@chromium.org BUG=632394 ==========
Description was changed from ========== Notify the main thread of parsed chunks less frequently This patch adds an experiment variant to the ParseHTMLOnMainThread experiment threaded group. It adds a group that uses the threaded parser, but coalesces token chunks in the background parser, notifying the main thread less often. This can often result in issuing preloads faster due to not eagerly parsing/scripting when tokens are about to come in. Note: this experiment group actually aligns the threaded behavior closer to the non-threaded behavior. The non-threaded experiment group has also runs the entirety of pumpTokenizer when it is tokenizing, whereas the threaded parser usually starts parsing at the first call to notifyPendingTokenizedChunks (if it is idle). This experiment group tries not to start the main thread parsing until we've tokenized a bit more. TBR=kinuko@chromium.org BUG=632394 ========== to ========== Notify the main thread of parsed chunks less frequently This patch adds an experiment variant to the ParseHTMLOnMainThread experiment threaded group. It adds a group that uses the threaded parser, but coalesces token chunks in the background parser, notifying the main thread less often. This can often result in issuing preloads faster due to not eagerly parsing/scripting when tokens are about to come in. Note: this experiment group actually aligns the threaded behavior closer to the non-threaded behavior. The non-threaded experiment group also runs the entirety of pumpTokenizer when it is tokenizing, whereas the threaded parser usually starts parsing at the first call to notifyPendingTokenizedChunks (if it is idle). This is usually very early on in pumpTokenizer, because we split up chunks very fine grained. This experiment group tries not to start the main thread parsing until we've tokenized a bit more. TBR=kinuko@chromium.org BUG=632394 ==========
Thank you. I've updated the description to state a bit clearer why this fits into the threaded experiment. Landing!
Description was changed from ========== Notify the main thread of parsed chunks less frequently This patch adds an experiment variant to the ParseHTMLOnMainThread experiment threaded group. It adds a group that uses the threaded parser, but coalesces token chunks in the background parser, notifying the main thread less often. This can often result in issuing preloads faster due to not eagerly parsing/scripting when tokens are about to come in. Note: this experiment group actually aligns the threaded behavior closer to the non-threaded behavior. The non-threaded experiment group also runs the entirety of pumpTokenizer when it is tokenizing, whereas the threaded parser usually starts parsing at the first call to notifyPendingTokenizedChunks (if it is idle). This is usually very early on in pumpTokenizer, because we split up chunks very fine grained. This experiment group tries not to start the main thread parsing until we've tokenized a bit more. TBR=kinuko@chromium.org BUG=632394 ========== to ========== ParseHTMLOnMainThread: notify main thread of chunks less frequently This patch adds an experiment variant to the ParseHTMLOnMainThread experiment threaded group. It adds a group that uses the threaded parser, but coalesces token chunks in the background parser, notifying the main thread less often. This can often result in issuing preloads faster due to not eagerly parsing/scripting when tokens are about to come in. Note: this experiment group actually aligns the threaded behavior closer to the non-threaded behavior. The non-threaded experiment group also runs the entirety of pumpTokenizer when it is tokenizing, whereas the threaded parser usually starts parsing at the first call to notifyPendingTokenizedChunks (if it is idle). This is usually very early on in pumpTokenizer, because we split up chunks very fine grained. This experiment group tries not to start the main thread parsing until we've tokenized a bit more. TBR=kinuko@chromium.org BUG=632394 ==========
The CQ bit was checked by csharrison@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Description was changed from ========== ParseHTMLOnMainThread: notify main thread of chunks less frequently This patch adds an experiment variant to the ParseHTMLOnMainThread experiment threaded group. It adds a group that uses the threaded parser, but coalesces token chunks in the background parser, notifying the main thread less often. This can often result in issuing preloads faster due to not eagerly parsing/scripting when tokens are about to come in. Note: this experiment group actually aligns the threaded behavior closer to the non-threaded behavior. The non-threaded experiment group also runs the entirety of pumpTokenizer when it is tokenizing, whereas the threaded parser usually starts parsing at the first call to notifyPendingTokenizedChunks (if it is idle). This is usually very early on in pumpTokenizer, because we split up chunks very fine grained. This experiment group tries not to start the main thread parsing until we've tokenized a bit more. TBR=kinuko@chromium.org BUG=632394 ========== to ========== ParseHTMLOnMainThread: notify main thread of chunks less frequently This patch adds an experiment variant to the ParseHTMLOnMainThread experiment threaded group. It adds a group that uses the threaded parser, but coalesces token chunks in the background parser, notifying the main thread less often. This can often result in issuing preloads faster due to not eagerly parsing/scripting when tokens are about to come in. Note: this experiment group actually aligns the threaded behavior closer to the non-threaded behavior. The non-threaded experiment group also runs the entirety of pumpTokenizer when it is tokenizing, whereas the threaded parser usually starts parsing at the first call to notifyPendingTokenizedChunks (if it is idle). This is usually very early on in pumpTokenizer, because we split up chunks very fine grained. This experiment group tries not to start the main thread parsing until we've tokenized a bit more. TBR=kinuko@chromium.org BUG=632394 ==========
Message was sent while issue was closed.
Committed patchset #3 (id:40001)
Message was sent while issue was closed.
Description was changed from ========== ParseHTMLOnMainThread: notify main thread of chunks less frequently This patch adds an experiment variant to the ParseHTMLOnMainThread experiment threaded group. It adds a group that uses the threaded parser, but coalesces token chunks in the background parser, notifying the main thread less often. This can often result in issuing preloads faster due to not eagerly parsing/scripting when tokens are about to come in. Note: this experiment group actually aligns the threaded behavior closer to the non-threaded behavior. The non-threaded experiment group also runs the entirety of pumpTokenizer when it is tokenizing, whereas the threaded parser usually starts parsing at the first call to notifyPendingTokenizedChunks (if it is idle). This is usually very early on in pumpTokenizer, because we split up chunks very fine grained. This experiment group tries not to start the main thread parsing until we've tokenized a bit more. TBR=kinuko@chromium.org BUG=632394 ========== to ========== ParseHTMLOnMainThread: notify main thread of chunks less frequently This patch adds an experiment variant to the ParseHTMLOnMainThread experiment threaded group. It adds a group that uses the threaded parser, but coalesces token chunks in the background parser, notifying the main thread less often. This can often result in issuing preloads faster due to not eagerly parsing/scripting when tokens are about to come in. Note: this experiment group actually aligns the threaded behavior closer to the non-threaded behavior. The non-threaded experiment group also runs the entirety of pumpTokenizer when it is tokenizing, whereas the threaded parser usually starts parsing at the first call to notifyPendingTokenizedChunks (if it is idle). This is usually very early on in pumpTokenizer, because we split up chunks very fine grained. This experiment group tries not to start the main thread parsing until we've tokenized a bit more. TBR=kinuko@chromium.org BUG=632394 Committed: https://crrev.com/803fb39346006820c009f206dc05dd62b12e82ee Cr-Commit-Position: refs/heads/master@{#408537} ==========
Message was sent while issue was closed.
Patchset 3 (id:??) landed as https://crrev.com/803fb39346006820c009f206dc05dd62b12e82ee Cr-Commit-Position: refs/heads/master@{#408537} |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
