text
stringlengths
1
474
Bugs and issues
For the full list of Impeller’s known bugs
and missing features,
the most up-to-date information is on the
Impeller project board on GitHub.The team continues to improve Impeller support.
If you encounter performance or fidelity issues
with Impeller on any platform,
file an issue in the GitHub tracker.
Prefix the issue title with [Impeller] and
include a small reproducible test case.Please include the following information when
submitting an issue for Impeller:<topic_end>
<topic_start>
Architecture
To learn more details about Impeller’s design and architecture,
check out the README.md file in the source tree.<topic_end>
<topic_start>
Additional Information
<topic_end>
<topic_start>Performance best practices
info Note
To learn how to use the Performance View
(part of Flutter DevTools)
for debugging performance issues,
see Using the Performance view.Generally, Flutter applications are performant by default,
so you only need to avoid common pitfalls to get excellent
performance. These best practice recommendations will help you
write the most performant Flutter app possible.info Note
If you are writing web apps in Flutter, you might be interested
in a series of articles, written by the Flutter Material team,
after they modified the Flutter Gallery app to make it more
performant on the web:How do you design a Flutter app to most efficiently
render your scenes? In particular, how do you ensure
that the painting code generated by the
framework is as efficient as possible?
Some rendering and layout operations are known
to be slow, but can’t always be avoided.
They should be used thoughtfully,
following the guidance below.<topic_end>
<topic_start>
Minimize expensive operations
Some operations are more expensive than others,
meaning that they consume more resources.
Obviously, you want to only use these operations
when necessary. How you design and implement your
app’s UI can have a big impact on how efficiently it runs.<topic_end>
<topic_start>
Control build() cost
Here are some things to keep in mind when designing your UI:For more information, check out:<topic_end>
<topic_start>
Use saveLayer() thoughtfully
Some Flutter code uses saveLayer(), an expensive operation,
to implement various visual effects in the UI.
Even if your code doesn’t explicitly call saveLayer(),
other widgets or packages that you use might call it behind the scenes.
Perhaps your app is calling saveLayer() more than necessary;
excessive calls to saveLayer() can cause jank.<topic_end>
<topic_start>Why is saveLayer expensive?
Calling saveLayer() allocates an offscreen buffer
and drawing content into the offscreen buffer might
trigger a render target switch.
The GPU wants to run like a firehose,
and a render target switch forces the GPU
to redirect that stream temporarily and then
direct it back again. On mobile GPUs this is
particularly disruptive to rendering throughput.<topic_end>
<topic_start>When is saveLayer required?
At runtime, if you need to dynamically display various shapes
coming from a server (for example), each with some transparency,
that might (or might not) overlap,
then you pretty much have to use saveLayer().<topic_end>
<topic_start>Debugging calls to saveLayer
How can you tell how often your app calls saveLayer(),
either directly or indirectly?
The saveLayer() method triggers
an event on the DevTools timeline; learn when
your scene uses saveLayer by checking the
PerformanceOverlayLayer.checkerboardOffscreenLayers
switch in the DevTools Performance view.<topic_end>
<topic_start>Minimizing calls to saveLayer
Can you avoid calls to saveLayer?
It might require rethinking of how you
create your visual effects:Note to package owners:
As a best practice, consider providing documentation
for when saveLayer might be necessary for your package,
how it might be avoided, and when it can’t be avoided.Other widgets that might trigger saveLayer()
and are potentially costly:<topic_end>
<topic_start>
Minimize use of opacity and clipping
Opacity is another expensive operation, as is clipping.
Here are some tips you might find to be useful:<topic_end>
<topic_start>
Implement grids and lists thoughtfully
How your grids and lists are implemented
might be causing performance problems for your app.
This section describes an important best
practice when creating grids and lists,
and how to determine whether your app uses
excessive layout passes.<topic_end>
<topic_start>Be lazy!
When building a large grid or list,