New issue
Advanced search Search tips

Issue 741961 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 738235



Sign in to add a comment

FMP GPU swap timestamp incorrect

Project Member Reported by shaseley@google.com, Jul 13 2017

Issue description

The swap-promise used to compute the GPU swap timestamp for FMP is not queued until SetFirstMeaninfulPaint is called, but this method is called with a timestamp that was computed *before* the network quiet timer fired and FMP was decided. The implications are that (1) when the swap promise is fulfilled, it's because of some other paint, and (2) there might not be any subsequent paints, and so we don't get a swap timestamp for FMP.

The FMP swap timestamp is not currently being used, so changing this will not affect other components/tests.
 
Project Member

Comment 1 by sheriffbot@chromium.org, Jul 13 2017

Labels: Hotlist-Google
Project Member

Comment 2 by bugdroid1@chromium.org, Jul 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/fc4cbe3804eb131d44aa1e7ece58087c33e7f242

commit fc4cbe3804eb131d44aa1e7ece58087c33e7f242
Author: Scott Haseley <shaseley@google.com>
Date: Mon Jul 17 18:40:46 2017

Change FMP swap timestamp to reflect swap time of FMP candidate

The swap-promise used to compute the GPU swap timestamp for FMP was not queued
until SetFirstMeaninfulPaint is called, but this method is called with a
timestamp that was computed before the network quiet timer fired and FMP was
decided. The implications are that (1) when the swap promise is fulfilled, it's
because of some other paint, and (2) there might not be any subsequent paints,
and so we don't get a swap timestamp for FMP.

This CL fixes the problem by having the FMP detector queue the swap-promise in
when the FMP candidate is selected, which is on the Paint path. PaintTiming
reports the swap time to the FMP detector when the swap-promise is fulfilled.
The FMP detector now reports both the swap and non-swap FMP timestamps to
PaintTiming when the FMP is finally chosen.

Bug:  741961 
Change-Id: I0fa9d396f6b46c90acea9f1a46e6d7cbbf5d7ef7
Reviewed-on: https://chromium-review.googlesource.com/570488
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Kunihiko Sakamoto <ksakamoto@chromium.org>
Commit-Queue: Scott Haseley <shaseley@google.com>
Cr-Commit-Position: refs/heads/master@{#487172}
[modify] https://crrev.com/fc4cbe3804eb131d44aa1e7ece58087c33e7f242/third_party/WebKit/Source/core/paint/BUILD.gn
[modify] https://crrev.com/fc4cbe3804eb131d44aa1e7ece58087c33e7f242/third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetector.cpp
[modify] https://crrev.com/fc4cbe3804eb131d44aa1e7ece58087c33e7f242/third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetector.h
[add] https://crrev.com/fc4cbe3804eb131d44aa1e7ece58087c33e7f242/third_party/WebKit/Source/core/paint/PaintEvent.h
[modify] https://crrev.com/fc4cbe3804eb131d44aa1e7ece58087c33e7f242/third_party/WebKit/Source/core/paint/PaintTiming.cpp
[modify] https://crrev.com/fc4cbe3804eb131d44aa1e7ece58087c33e7f242/third_party/WebKit/Source/core/paint/PaintTiming.h

Project Member

Comment 3 by bugdroid1@chromium.org, Aug 9 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5f78548f700039bbfa3ee08a7a310a797f9e33f3

commit 5f78548f700039bbfa3ee08a7a310a797f9e33f3
Author: Scott Haseley <shaseley@google.com>
Date: Wed Aug 09 05:40:59 2017

Defer reporting FMP timestamp until SwapPromises complete

There are three corner cases with capturing the FMP swap timestamp that
this CL addresses:

1) If the provisional FMP timestamp is set, resulting in a queued
SwapPromise, and the 2-quiet timer fires before the SwapPromise
is fulfilled, then we do not report an FMP timestamp.

2) If the provisional FMP timestamp is set again while still waiting
for the previous SwapPromise, resulting in two outstanding
SwapPromises, and the 2-quiet timer fires in between SwapPromises,
then the wrong FMP swap timestamp will be reported. For example, the
following sequence of events can occur:
  a) Set provisional FMP & queue SwapPromise
  b) Set provisional FMP & queue SwapPromise
  c) Recieve SwapPromise result from (a)
  d) 2-quiet timer fires
  e) Recieve SwapPromise result from (b)
In this case, FMP is reported in (d) using the provisional FMP
timestamp from (b), but the SwapPromise timestamp corresponding to (a).

3) If the provisional FMP timestamp is less than the FCP timestamp when
the 2-quiet timer fires, we use FCP. However, if this timer fires
before the FCP SwapPromise has been fulfilled, then we report no FMP
swap timestamp.

To address these corner cases, reporting the FMP timestamp is deferred
if we either have any pending SwapPromises when the 2-quiet timer fires
or if we use the FCP timestamp but the corresponding FCP-swap timestamp
isn't set. In the first case, when the the number of outstanding
SwapPromises reaches 0, we report FMP. In the latter case, PaintTiming
informs the FirstMeaningfulPaintDetector when the swap timestamp is
available, and FMP is reported at that point.

Bug:  741961 
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I202e668ab3295f7a1ee2bb10f925e54966b92c18
Reviewed-on: https://chromium-review.googlesource.com/599117
Reviewed-by: Shubhie Panicker <panicker@chromium.org>
Reviewed-by: Kunihiko Sakamoto <ksakamoto@chromium.org>
Reviewed-by: Steve Kobes <skobes@chromium.org>
Commit-Queue: Scott Haseley <shaseley@google.com>
Cr-Commit-Position: refs/heads/master@{#492835}
[modify] https://crrev.com/5f78548f700039bbfa3ee08a7a310a797f9e33f3/third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetector.cpp
[modify] https://crrev.com/5f78548f700039bbfa3ee08a7a310a797f9e33f3/third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetector.h
[modify] https://crrev.com/5f78548f700039bbfa3ee08a7a310a797f9e33f3/third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetectorTest.cpp
[modify] https://crrev.com/5f78548f700039bbfa3ee08a7a310a797f9e33f3/third_party/WebKit/Source/core/paint/PaintTiming.cpp
[modify] https://crrev.com/5f78548f700039bbfa3ee08a7a310a797f9e33f3/third_party/WebKit/Source/core/paint/PaintTiming.h

Comment 4 by shaseley@google.com, Aug 31 2017

Status: Fixed (was: Started)

Sign in to add a comment