Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Engine should eagerly call onBeginFrame after running Dart's main() #3488

Closed
Hixie opened this issue Apr 22, 2016 · 9 comments
Closed

Engine should eagerly call onBeginFrame after running Dart's main() #3488

Hixie opened this issue Apr 22, 2016 · 9 comments
Labels
c: performance Relates to speed or footprint issues (see "perf:" labels) c: proposal A detailed proposal for a change to Flutter engine flutter/engine repository. See also e: labels. P3 Issues that are less important to the Flutter project team-engine Owned by Engine team triaged-engine Triaged by Engine team

Comments

@Hixie
Copy link
Contributor

Hixie commented Apr 22, 2016

There's no reason for us to wait. On average, waiting means we wait 8ms of startup time doing nothing.

@Hixie Hixie added engine flutter/engine repository. See also e: labels. c: performance Relates to speed or footprint issues (see "perf:" labels) labels Apr 22, 2016
@Hixie Hixie added this to the Flutter 1.0 milestone Apr 22, 2016
Hixie added a commit to Hixie/flutter that referenced this issue Apr 22, 2016
There shouldn't be any reason to do this.

This might cause a minor perf regression until we fix flutter#3488.
@dragostis
Copy link
Contributor

dragostis commented Aug 31, 2016

Is this bug still relevant?

Running

void main() {
  DateTime now = new DateTime.now();

  ui.window.onBeginFrame = (Duration timeStamp) {
    print(new DateTime.now().difference(now));
  };
}

consistently prints ~2ms.

@Hixie
Copy link
Contributor Author

Hixie commented Aug 31, 2016

Weird. Why 2ms? I would have expected 0ms or an even spread from 0 to 16ms.

@dragostis dragostis self-assigned this Aug 31, 2016
@Hixie
Copy link
Contributor Author

Hixie commented Aug 31, 2016

I see a variety of numbers testing both release and debug on a Nexus 6.
Debug seems to be 0-16ms, release seems to be 11ms-100+ms.
Also, in release for some reason we seem to call onBeginFrame twice in quick succession.

In conclusion, this bug is still relevant. :-)

@dragostis dragostis removed their assignment Sep 22, 2016
@jhirth
Copy link

jhirth commented May 7, 2017

Also, in release for some reason we seem to call onBeginFrame twice in quick succession.

On my device, it always starts with 2 window.onMetricsChanged calls where window.physicalSize is still 0x0.

Does that event also trigger a redraw?

@abarth
Copy link
Contributor

abarth commented May 7, 2017

Does that event also trigger a redraw?

By itself, that does not trigger a redraw, but it's common for code that's listening to that event to schedule a redraw.

@zoechi
Copy link
Contributor

zoechi commented Nov 30, 2018

Is this issue still relevant?

@Hixie Hixie modified the milestones: Stretch Goals, New Stretch Goals Jan 7, 2020
@kf6gpe kf6gpe added the P3 Issues that are less important to the Flutter project label May 29, 2020
@kf6gpe kf6gpe modified the milestone: Stretch Goals Jun 1, 2020
@Hixie Hixie removed this from the [DEPRECATED] Stretch Goals milestone Jun 16, 2020
@kf6gpe kf6gpe removed this from the [DEPRECATED] Stretch Goals milestone Jul 7, 2020
@kf6gpe kf6gpe modified the milestone: [DEPRECATED] Stretch Goals Jul 22, 2020
@Hixie Hixie removed this from the - milestone Aug 17, 2020
@markusaksli-nc
Copy link
Contributor

Engine doesn't seem to call this after Dart's main(). Can only get a print if I use runApp() at some point as well (but the duration is no longer useful then).

@markusaksli-nc markusaksli-nc added passed first triage c: proposal A detailed proposal for a change to Flutter labels Sep 28, 2020
@flutter-triage-bot flutter-triage-bot bot added team-engine Owned by Engine team triaged-engine Triaged by Engine team labels Jul 7, 2023
@chinmaygarde
Copy link
Member

Today, frame scheduling begins eagerly as soon as the rasterizer is setup.

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: performance Relates to speed or footprint issues (see "perf:" labels) c: proposal A detailed proposal for a change to Flutter engine flutter/engine repository. See also e: labels. P3 Issues that are less important to the Flutter project team-engine Owned by Engine team triaged-engine Triaged by Engine team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants