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
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…