|
|
Chromium Code Reviews|
Created:
3 years, 9 months ago by yoichio Modified:
3 years, 9 months ago Reviewers:
yosin_UTC9 CC:
blink-reviews, chromium-reviews Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionReduce canonicalization when dragging
This CL avoids VisibleSelectionInFlatTree creation if VSInDOMTree is none
in SelectionEditor.cpp.
This reduces redundant canonicalization because
VSInFlatTree availability == VSInDOMTree availability
BUG=668122
TEST=
1. Open the page on comment#21 described at the bug.
2. Open also chrome://tracing/ and record Input Latency.
3. Confirm Messaseloop::RunTask blocking time gets faster 3.7 times(from 64ms to 17ms).
Review-Url: https://codereview.chromium.org/2741173002
Cr-Commit-Position: refs/heads/master@{#457376}
Committed: https://chromium.googlesource.com/chromium/src/+/d51024e6850f785d2bb364af8d63f742126f7a91
Patch Set 1 #Patch Set 2 : update #
Total comments: 10
Patch Set 3 : update #
Total comments: 2
Patch Set 4 : update #
Messages
Total messages: 38 (28 generated)
The CQ bit was checked by yoichio@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 ========== dragg perf BUG= ========== to ========== dragg perf cc::ProxyMain::BeginMainFrame content::RenderWidget::WillBeginCompositorFrame 1. rootEditableElement without VisibleSelection it is ok because canonicalization don't cross editing boundary 2. Avoid FlatTree creation if DomTree selection is none BUG= ==========
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...)
The CQ bit was checked by yoichio@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 ========== dragg perf cc::ProxyMain::BeginMainFrame content::RenderWidget::WillBeginCompositorFrame 1. rootEditableElement without VisibleSelection it is ok because canonicalization don't cross editing boundary 2. Avoid FlatTree creation if DomTree selection is none BUG= ========== to ========== dragg perf cc::ProxyMain::BeginMainFrame content::RenderWidget::WillBeginCompositorFrame 1. rootEditableElement without VisibleSelection it is ok because canonicalization don't cross editing boundary 2. Avoid FlatTree creation if DomTree selection is none BUG=668122 TEST= 1. Open the page on comment#21 described at the bug. 2. Open also chrome://tracing/ and record Input Latency. 3. Confirm Messaseloop::RunTask blocking time gets faster 2.5 times(from 80ms to 30ms). ==========
Description was changed from ========== dragg perf cc::ProxyMain::BeginMainFrame content::RenderWidget::WillBeginCompositorFrame 1. rootEditableElement without VisibleSelection it is ok because canonicalization don't cross editing boundary 2. Avoid FlatTree creation if DomTree selection is none BUG=668122 TEST= 1. Open the page on comment#21 described at the bug. 2. Open also chrome://tracing/ and record Input Latency. 3. Confirm Messaseloop::RunTask blocking time gets faster 2.5 times(from 80ms to 30ms). ========== to ========== Reduce canonicalization when dragging This CL does 1. Use rootEditableElementOf(Position) instead of computeVisiblePosition.rootEditableElement(). (InputMethodController.cpp, FrameCaret.cpp) This conversion is O.K. because canonicalicalization doesn't go over EditingBoundary in which rootEditableElement traverses to find root element. In addition, move calling rootEditableElement below early returns which return also WebTextInputTypeNone to reduce rootEditableElement calls. 2. Avoid VisibleSelectionInFlatTree creation if VSInDOMTree is none in SelectionEditor.cpp. This reduces redundant canonicalization because VSInFlatTree availability == VSInDOMTree availability Unfortunately, WebKit/PerformanceTests/Editing/mouse-move-with-hidden-elements.html doesn't measure this performance improvement because it goes through another code path to original issue's. BUG=668122 TEST= 1. Open the page on comment#21 described at the bug. 2. Open also chrome://tracing/ and record Input Latency. 3. Confirm Messaseloop::RunTask blocking time gets faster 2.5 times(from 80ms to 30ms). ==========
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...)
Description was changed from ========== Reduce canonicalization when dragging This CL does 1. Use rootEditableElementOf(Position) instead of computeVisiblePosition.rootEditableElement(). (InputMethodController.cpp, FrameCaret.cpp) This conversion is O.K. because canonicalicalization doesn't go over EditingBoundary in which rootEditableElement traverses to find root element. In addition, move calling rootEditableElement below early returns which return also WebTextInputTypeNone to reduce rootEditableElement calls. 2. Avoid VisibleSelectionInFlatTree creation if VSInDOMTree is none in SelectionEditor.cpp. This reduces redundant canonicalization because VSInFlatTree availability == VSInDOMTree availability Unfortunately, WebKit/PerformanceTests/Editing/mouse-move-with-hidden-elements.html doesn't measure this performance improvement because it goes through another code path to original issue's. BUG=668122 TEST= 1. Open the page on comment#21 described at the bug. 2. Open also chrome://tracing/ and record Input Latency. 3. Confirm Messaseloop::RunTask blocking time gets faster 2.5 times(from 80ms to 30ms). ========== to ========== Reduce canonicalization when dragging This CL does 1. Use rootEditableElementOf(Position) instead of computeVisiblePosition.rootEditableElement(). (InputMethodController.cpp, FrameCaret.cpp) This conversion is O.K. because canonicalicalization doesn't go over EditingBoundary in which rootEditableElement traverses to find root element. In addition, move calling rootEditableElement below early returns which return also WebTextInputTypeNone to reduce rootEditableElement calls. 2. Avoid VisibleSelectionInFlatTree creation if VSInDOMTree is none in SelectionEditor.cpp. This reduces redundant canonicalization because VSInFlatTree availability == VSInDOMTree availability Unfortunately, WebKit/PerformanceTests/Editing/mouse-move-with-hidden-elements.html doesn't measure this performance improvement because it goes through another code path to original issue's. BUG=668122 TEST= 1. Open the page on comment#21 described at the bug. 2. Open also chrome://tracing/ and record Input Latency. 3. Confirm Messaseloop::RunTask blocking time gets faster 3.7 times(from 64ms to 17ms). ==========
The CQ bit was checked by yoichio@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...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Description was changed from ========== Reduce canonicalization when dragging This CL does 1. Use rootEditableElementOf(Position) instead of computeVisiblePosition.rootEditableElement(). (InputMethodController.cpp, FrameCaret.cpp) This conversion is O.K. because canonicalicalization doesn't go over EditingBoundary in which rootEditableElement traverses to find root element. In addition, move calling rootEditableElement below early returns which return also WebTextInputTypeNone to reduce rootEditableElement calls. 2. Avoid VisibleSelectionInFlatTree creation if VSInDOMTree is none in SelectionEditor.cpp. This reduces redundant canonicalization because VSInFlatTree availability == VSInDOMTree availability Unfortunately, WebKit/PerformanceTests/Editing/mouse-move-with-hidden-elements.html doesn't measure this performance improvement because it goes through another code path to original issue's. BUG=668122 TEST= 1. Open the page on comment#21 described at the bug. 2. Open also chrome://tracing/ and record Input Latency. 3. Confirm Messaseloop::RunTask blocking time gets faster 3.7 times(from 64ms to 17ms). ========== to ========== Reduce canonicalization when dragging This CL does 1. Use rootEditableElementOf(Position) instead of computeVisiblePosition.rootEditableElement(). (InputMethodController.cpp, FrameCaret.cpp) This conversion is O.K. because canonicalicalization doesn't go over EditingBoundary in which rootEditableElement traverses to find root element. In addition, move calling rootEditableElement below the early returns which return also WebTextInputTypeNone to reduce rootEditableElement calls. 2. Avoid VisibleSelectionInFlatTree creation if VSInDOMTree is none in SelectionEditor.cpp. This reduces redundant canonicalization because VSInFlatTree availability == VSInDOMTree availability Unfortunately, WebKit/PerformanceTests/Editing/mouse-move-with-hidden-elements.html doesn't measure this performance improvement because it goes through another code path to original issue's. BUG=668122 TEST= 1. Open the page on comment#21 described at the bug. 2. Open also chrome://tracing/ and record Input Latency. 3. Confirm Messaseloop::RunTask blocking time gets faster 3.7 times(from 64ms to 17ms). ==========
yoichio@chromium.org changed reviewers: + yosin@chromium.org
https://codereview.chromium.org/2741173002/diff/20001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/editing/FrameCaret.cpp (right): https://codereview.chromium.org/2741173002/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/core/editing/FrameCaret.cpp:208: rootEditableElementOf(m_selectionEditor->selectionInDOMTree().base()); Could you move change in another CL? This change is independent from others. https://codereview.chromium.org/2741173002/diff/20001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/editing/InputMethodController.cpp (left): https://codereview.chromium.org/2741173002/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/core/editing/InputMethodController.cpp:1035: .computeVisibleSelectionInDOMTreeDeprecated() Let's do mechanical change for computeVisibleSelectionInDOMDeprecaerd().rootEditableElement() to rootEditableElement(...selectionInDOMTree().base()) in another patch. https://codereview.chromium.org/2741173002/diff/20001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/editing/InputMethodController.cpp (right): https://codereview.chromium.org/2741173002/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/core/editing/InputMethodController.cpp:1187: // It's important to preserve the equivalence of textInputInfo().type and Please have another patch to moving this block. https://codereview.chromium.org/2741173002/diff/20001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/editing/SelectionController.cpp (right): https://codereview.chromium.org/2741173002/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/core/editing/SelectionController.cpp:390: if (basePosition.isNull()) Could you move this change in another patch? with adding |DCHECK(basePosition.isNotNull())| in |applySelectAll()|. https://codereview.chromium.org/2741173002/diff/20001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/editing/SelectionEditor.cpp (right): https://codereview.chromium.org/2741173002/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/core/editing/SelectionEditor.cpp:374: if (m_cachedVisibleSelectionInDOMTree.isNone()) { Good catch! Please move this shortcut in another patch. We would like to split SelectionEditor::udpateCahceVisibleSelectionIfNeeded() into to one for DOM tree and another for Flat Tree. We don't need to compute DOM tree version and Flat Tree version same time, e.g. execCommand() only needs DOM tree version and painting needs only Flat Tree version. This is my mistake that having only one cache.
BTW, Unfortunately, WebKit/PerformanceTests/Editing/mouse-move-with-hidden-elements.html doesn't measure this performance improvement because it goes through another code path to original issue's. If this description is true, this patch isn't related to issue 668122
The CQ bit was checked by yoichio@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...
> Unfortunately, > WebKit/PerformanceTests/Editing/mouse-move-with-hidden-elements.html doesn't > measure this performance improvement because it goes through another > code path to original issue's. > > If this description is true, this patch isn't related to the issue No, this fixes the issue. My mistake is that mouse-move-with-hidden-elements.html doesn't measure the issue. https://codereview.chromium.org/2741173002/diff/20001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/editing/FrameCaret.cpp (right): https://codereview.chromium.org/2741173002/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/core/editing/FrameCaret.cpp:208: rootEditableElementOf(m_selectionEditor->selectionInDOMTree().base()); On 2017/03/16 02:30:05, yosin_UTC9 wrote: > Could you move change in another CL? > This change is independent from others. Acknowledged. https://codereview.chromium.org/2741173002/diff/20001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/editing/InputMethodController.cpp (left): https://codereview.chromium.org/2741173002/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/core/editing/InputMethodController.cpp:1035: .computeVisibleSelectionInDOMTreeDeprecated() On 2017/03/16 02:30:05, yosin_UTC9 wrote: > Let's do mechanical change for > > computeVisibleSelectionInDOMDeprecaerd().rootEditableElement() to > rootEditableElement(...selectionInDOMTree().base()) > > in another patch. Acknowledged. https://codereview.chromium.org/2741173002/diff/20001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/editing/InputMethodController.cpp (right): https://codereview.chromium.org/2741173002/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/core/editing/InputMethodController.cpp:1187: // It's important to preserve the equivalence of textInputInfo().type and On 2017/03/16 02:30:05, yosin_UTC9 wrote: > Please have another patch to moving this block. Acknowledged. https://codereview.chromium.org/2741173002/diff/20001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/editing/SelectionController.cpp (right): https://codereview.chromium.org/2741173002/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/core/editing/SelectionController.cpp:390: if (basePosition.isNull()) On 2017/03/16 02:30:05, yosin_UTC9 wrote: > Could you move this change in another patch? > with adding |DCHECK(basePosition.isNotNull())| in |applySelectAll()|. This needs because of SelectionEditor change. Somehow in L346-350, we get "valid" |targetPosition| but null |basePosition|. I'm suspicious about this code that we get VSinDOM first and covert it to VSinFlat. We should get VSinFlat directly? Anyway this should be done in another patch. https://codereview.chromium.org/2741173002/diff/20001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/editing/SelectionEditor.cpp (right): https://codereview.chromium.org/2741173002/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/core/editing/SelectionEditor.cpp:374: if (m_cachedVisibleSelectionInDOMTree.isNone()) { On 2017/03/16 02:30:05, yosin_UTC9 wrote: > Good catch! > > Please move this shortcut in another patch. > This is core of this CL and needs for performance improvement. > We would like to split SelectionEditor::udpateCahceVisibleSelectionIfNeeded() > into to one for DOM tree and another for Flat Tree. > We don't need to compute DOM tree version and Flat Tree version same time, e.g. > execCommand() only needs DOM tree version and painting needs only Flat Tree > version. > > This is my mistake that having only one cache. We should do with fixing dragging selection code
Description was changed from ========== Reduce canonicalization when dragging This CL does 1. Use rootEditableElementOf(Position) instead of computeVisiblePosition.rootEditableElement(). (InputMethodController.cpp, FrameCaret.cpp) This conversion is O.K. because canonicalicalization doesn't go over EditingBoundary in which rootEditableElement traverses to find root element. In addition, move calling rootEditableElement below the early returns which return also WebTextInputTypeNone to reduce rootEditableElement calls. 2. Avoid VisibleSelectionInFlatTree creation if VSInDOMTree is none in SelectionEditor.cpp. This reduces redundant canonicalization because VSInFlatTree availability == VSInDOMTree availability Unfortunately, WebKit/PerformanceTests/Editing/mouse-move-with-hidden-elements.html doesn't measure this performance improvement because it goes through another code path to original issue's. BUG=668122 TEST= 1. Open the page on comment#21 described at the bug. 2. Open also chrome://tracing/ and record Input Latency. 3. Confirm Messaseloop::RunTask blocking time gets faster 3.7 times(from 64ms to 17ms). ========== to ========== Reduce canonicalization when dragging This CL avoids VisibleSelectionInFlatTree creation if VSInDOMTree is none in SelectionEditor.cpp. This reduces redundant canonicalization because VSInFlatTree availability == VSInDOMTree availability Unfortunately, WebKit/PerformanceTests/Editing/mouse-move-with-hidden-elements.html doesn't measure this performance improvement because it goes through another code path to original issue's. BUG=668122 TEST= 1. Open the page on comment#21 described at the bug. 2. Open also chrome://tracing/ and record Input Latency. 3. Confirm Messaseloop::RunTask blocking time gets faster 3.7 times(from 64ms to 17ms). ==========
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Any thoughts?
Description was changed from ========== Reduce canonicalization when dragging This CL avoids VisibleSelectionInFlatTree creation if VSInDOMTree is none in SelectionEditor.cpp. This reduces redundant canonicalization because VSInFlatTree availability == VSInDOMTree availability Unfortunately, WebKit/PerformanceTests/Editing/mouse-move-with-hidden-elements.html doesn't measure this performance improvement because it goes through another code path to original issue's. BUG=668122 TEST= 1. Open the page on comment#21 described at the bug. 2. Open also chrome://tracing/ and record Input Latency. 3. Confirm Messaseloop::RunTask blocking time gets faster 3.7 times(from 64ms to 17ms). ========== to ========== Reduce canonicalization when dragging This CL avoids VisibleSelectionInFlatTree creation if VSInDOMTree is none in SelectionEditor.cpp. This reduces redundant canonicalization because VSInFlatTree availability == VSInDOMTree availability BUG=668122 TEST= 1. Open the page on comment#21 described at the bug. 2. Open also chrome://tracing/ and record Input Latency. 3. Confirm Messaseloop::RunTask blocking time gets faster 3.7 times(from 64ms to 17ms). ==========
lgtm w/ nit Please move "Unfortunately, ..." from description to crbug.com, it makes me confusing. https://codereview.chromium.org/2741173002/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/editing/SelectionEditor.cpp (right): https://codereview.chromium.org/2741173002/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/core/editing/SelectionEditor.cpp:387: m_styleVersion = document().styleVersion(); Could you move L387 and L388 to L373 and make L374 to early return-style to reduce indentation and make patch size smaller. m_styleVersion = document().styleVersion(); m_cacheIsDirty = false; m_cachedVisibleSelectionInDOMTree = createVisibleSelection(m_selection); if (m_cachedVisibleSelectionInDOMTree.isNone()) { m_cachedVisibleSelectionInFlatTree = VisibleSelectionInFlatTree(); return; } ...
Also, please update summary to describe this change, e.g. Make SE::updateXXX not to compute flat tree VS if DOM VS is none.
Thanks https://codereview.chromium.org/2741173002/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/editing/SelectionEditor.cpp (right): https://codereview.chromium.org/2741173002/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/core/editing/SelectionEditor.cpp:387: m_styleVersion = document().styleVersion(); On 2017/03/16 06:39:18, yosin_UTC9 wrote: > Could you move L387 and L388 to L373 and make L374 to early return-style to > reduce indentation and make patch size smaller. > > m_styleVersion = document().styleVersion(); > m_cacheIsDirty = false; > m_cachedVisibleSelectionInDOMTree = createVisibleSelection(m_selection); > if (m_cachedVisibleSelectionInDOMTree.isNone()) { > m_cachedVisibleSelectionInFlatTree = VisibleSelectionInFlatTree(); > return; > } > ... Done.
The CQ bit was checked by yoichio@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from yosin@chromium.org Link to the patchset: https://codereview.chromium.org/2741173002/#ps60001 (title: "update")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch.
Bot data: {"patchset_id": 60001, "attempt_start_ts": 1489647405444490,
"parent_rev": "20bd5b1c1e57d402e3e300b4175ec52a7597f64e", "commit_rev":
"d51024e6850f785d2bb364af8d63f742126f7a91"}
Message was sent while issue was closed.
Description was changed from ========== Reduce canonicalization when dragging This CL avoids VisibleSelectionInFlatTree creation if VSInDOMTree is none in SelectionEditor.cpp. This reduces redundant canonicalization because VSInFlatTree availability == VSInDOMTree availability BUG=668122 TEST= 1. Open the page on comment#21 described at the bug. 2. Open also chrome://tracing/ and record Input Latency. 3. Confirm Messaseloop::RunTask blocking time gets faster 3.7 times(from 64ms to 17ms). ========== to ========== Reduce canonicalization when dragging This CL avoids VisibleSelectionInFlatTree creation if VSInDOMTree is none in SelectionEditor.cpp. This reduces redundant canonicalization because VSInFlatTree availability == VSInDOMTree availability BUG=668122 TEST= 1. Open the page on comment#21 described at the bug. 2. Open also chrome://tracing/ and record Input Latency. 3. Confirm Messaseloop::RunTask blocking time gets faster 3.7 times(from 64ms to 17ms). Review-Url: https://codereview.chromium.org/2741173002 Cr-Commit-Position: refs/heads/master@{#457376} Committed: https://chromium.googlesource.com/chromium/src/+/d51024e6850f785d2bb364af8d63... ==========
Message was sent while issue was closed.
Committed patchset #4 (id:60001) as https://chromium.googlesource.com/chromium/src/+/d51024e6850f785d2bb364af8d63... |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
