Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@iskakaushik
Copy link
Contributor

@iskakaushik iskakaushik commented Apr 22, 2020

This change converts it from an events that spans a time interval
to an event that occurs at an instant.

We also emit this trace event when there is no lag as opposed to
only when there was a lag to make it monotonous.

fixes: flutter/flutter#54629

@iskakaushik iskakaushik requested a review from liyuqian April 22, 2020 18:21
@auto-assign auto-assign bot requested a review from chinmaygarde April 22, 2020 18:21
@iskakaushik
Copy link
Contributor Author

Context: I'm running into multiple issues with the way the benchmarks treat async events, see: flutter/flutter#54629 (comment). Also for now, I'm only relying on vsync_transitions_missed so I don't really use the start and end timestamps.

This change converts it from an events that spans a time interval
to an event that occurs at an instant.

We also emit this trace event when there is no lag as opposed to
only when there was a lag to make it monotonous.
@iskakaushik iskakaushik force-pushed the scene-lag-sync-event branch from 26647ae to 5887587 Compare April 22, 2020 18:39
Copy link
Contributor

@liyuqian liyuqian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, I think it would be nice to have unit tests for our tracing events. Not sure how much work it needs so it might be out of scope for this PR to fix flutter/flutter#54629 quickly. Just bring this up to solicit more discussions from folks.

vsync_transitions_missed // arg_val_3
);
vsync_transitions_missed =
std::to_string(round(frame_lag / frame_budget_millis));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use ceiling instead of round here? Say if a frame has a lag of 0.1 frame, it seems to still cause 1 vsync transition to be missed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see both sides to the argument here. If there is 0.1 frame, there might be too much variance to do much to avoid this. It might be "too much" penalty on the app developer to charge a full frame worth of lag. That was the intent in using round.

One other alternative is to keep this as a float instead of int, we can retain say .2f precision. WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... maybe I misunderstood the definition of vsync_transitions_missed as it was round before (and I'm Ok to just use round in this PR as this PR is just fixing the async events).

To better understand the definition of vsync_transitions_missed, I went back and checked the examples in #17384 (comment). That example says frame_lag = 17 (ms), missed = 2. Since a frame is roughly 16ms, the 17 (ms) frame_lag is a lag of 1.0625 frame. Then only a ceil would make it 2 instead of 1. It seems that we intended to give "too much" penalty even for a little lag above a single frame time?

vsync_transitions_missed // arg_val_3
);
vsync_transitions_missed =
std::to_string(round(frame_lag / frame_budget_millis));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... maybe I misunderstood the definition of vsync_transitions_missed as it was round before (and I'm Ok to just use round in this PR as this PR is just fixing the async events).

To better understand the definition of vsync_transitions_missed, I went back and checked the examples in #17384 (comment). That example says frame_lag = 17 (ms), missed = 2. Since a frame is roughly 16ms, the 17 (ms) frame_lag is a lag of 1.0625 frame. Then only a ceil would make it 2 instead of 1. It seems that we intended to give "too much" penalty even for a little lag above a single frame time?

@iskakaushik
Copy link
Contributor Author

@liyuqian , I'm still debating what I want the behavior to be. I will see how some benchmarks play out and I will revise this metric as needed. You're right though, the original intent seems more inline with ceil.

@iskakaushik iskakaushik merged commit a544b45 into flutter:master Apr 23, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Apr 23, 2020
liyuqian added a commit that referenced this pull request Apr 24, 2020
liyuqian added a commit that referenced this pull request Apr 24, 2020
…17916)

This reverts commit a544b45.

Reverts #17878

This breaks our devicelab tests.

TBR: @flar
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Apr 24, 2020
iskakaushik added a commit to iskakaushik/engine that referenced this pull request Apr 24, 2020
This change converts it from an events that spans a time interval
to an event that occurs at an instant.

We also emit this trace event when there is no lag as opposed to
only when there was a lag to make it monotonous.

Co-authored-by: Kaushik Iska <kaushikiska@google.com>
iskakaushik added a commit to iskakaushik/engine that referenced this pull request Apr 24, 2020
This change converts it from an events that spans a time interval
to an event that occurs at an instant.

We also emit this trace event when there is no lag as opposed to
only when there was a lag to make it monotonous.

Co-authored-by: Kaushik Iska <kaushikiska@google.com>
iskakaushik added a commit to iskakaushik/engine that referenced this pull request Apr 24, 2020
This change converts it from an events that spans a time interval
to an event that occurs at an instant.

We also emit this trace event when there is no lag as opposed to
only when there was a lag to make it monotonous.

Co-authored-by: Kaushik Iska <kaushikiska@google.com>
iskakaushik added a commit to iskakaushik/engine that referenced this pull request Apr 24, 2020
This change converts it from an events that spans a time interval
to an event that occurs at an instant.

We also emit this trace event when there is no lag as opposed to
only when there was a lag to make it monotonous.

Co-authored-by: Kaushik Iska <kaushikiska@google.com>
"flutter", // category
"SceneDisplayLag", // name
raster_finish_time, // begin_time
latest_frame_target_time, // end_time
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the begin/end be frame_target_time, raster_finish_time?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

animated_placeholder_perf 99th_percentile_frame_rasterizer_time_millis regression

4 participants