Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
424 views
in Technique[技术] by (71.8m points)

how to find performance issue and fix in flutter

I am using dart to develop a flutter(version 1.22.5) app, in my Android Studio(version 4.1.2), I found some frame render very slow(60 frame/s is good, now only 1/2) like this:

enter image description here

but the problem is, I do not know where make the render slow, how to find the performance issue? I know it slow, but where? what should I do to find it out? Is there any tips?

question from:https://stackoverflow.com/questions/65879341/how-to-find-performance-issue-and-fix-in-flutter

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

First you should apply Flutter performance best practices. After reading it you will probably optimize a few things.

Then you can check with Flutter performance profiling

The overlay should always be viewed in profile mode, since debug mode performance is intentionally sacrificed in exchange for expensive asserts that are intended to aid development, and thus the results are misleading.

When both graphs display red, start by diagnosing the UI thread.

In short it often comes mainly from non cached images, UI animation, etc

Also if GPU bar is high, it might be an algorithm issue (like the way you coded your raytracer is not optimized).

If you still have issue with performance you can try to run your app with SkSL warm-up


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...