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

Detect shader compilation jank #971

Closed
ueman opened this issue Aug 2, 2022 · 4 comments
Closed

Detect shader compilation jank #971

ueman opened this issue Aug 2, 2022 · 4 comments

Comments

@ueman
Copy link
Collaborator

ueman commented Aug 2, 2022

The idea is to detect shader compilation jank and then tell users, that they can improve it by following https://docs.flutter.dev/perf/shader.

Shader compilation only happens on a cold app start. Which means, comparing framedata from a cold start vs a warm start could give some indication? But that comparison is also just meaningful if the user of the app does the same thing after both app starts. Maybe some clever heuristic paired with the navigation observer does the trick?

There's https://api.flutter.dev/flutter/dart-ui/FrameTiming-class.html but only on newer Flutter versions (> 2.5 or 2.8 I believe. Also properties of that class are less on older versions). That can be used to do the calculation.
You can do some assumption regarding which framephases (https://api.flutter.dev/flutter/dart-ui/FramePhase.html) take too much time.

Since manual shader compilation is quite some work, there should be a way to opt-in/out, depending on the default.

@marandaneto
Copy link
Contributor

@ueman Maybe this is less relevant now since Impeller will likely replace Skia and shaders will be compiled at compile time, does that make sense?

@ueman
Copy link
Collaborator Author

ueman commented Nov 21, 2022

I mean it would still be nice to be able to detect it, but I don't mind closing this. I've opened this issue after Bruno asked me to.

@marandaneto
Copy link
Contributor

Lets see how Impeller is going to play out before working on this, I do agree it makes sense, but if working on this means deprecating it soonish, it does not make much sense.

@marandaneto
Copy link
Contributor

Closed in favor of #1106
Profiling would give this for free whenever is available/possible on Flutter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

3 participants