Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

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

How to measure the flutter performance and rendering time

i am a new in flutter.What is mean?red bars.Is it bad? enter image description here

question from:https://stackoverflow.com/questions/66055220/how-to-measure-the-flutter-performance-and-rendering-time

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

1 Reply

0 votes
by (71.8m points)

Performance is a serious concern for many developer, We have do lot of special attention on this part.

Performance is nothing but the if UI and GPU doesn't complete their work in 60ms its cause to performance issue

  1. When your analysis the flutter application performance you must to launch the application in flutter profile mode

  2. If your using the android studio it's under the run-> Flutter Run in profile mode or If your using the VsCode --> command: flutter run -d [deviceID] --profile

  3. In VsCode open the DevTools and enable the --> show performance overlay

  4. After enable the overlay it will show like below gif on your realtime device or emulator

enter image description here

  1. There is two thing top I GPU and second one is UI

  2. While checking you use case the both GPU and CPU shows Red line.

enter image description here

  1. If it's show red line in both the GPU and UI its concerns you have to reduce the too much work on certain performing action in your application.

  2. If UI alone showing too much red line that also need to consider to reduce the UI rendering in current screen of your application.

  3. At last check the memory leak of your application in DevTools

  1. Refer the flutter https://flutter.dev/docs/perf/rendering/ui-performance for reference too

  2. https://flutter.dev/docs/perf


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...