@@ -36,7 +36,8 @@ steps to take, and tools that can help.
3636## Diagnosing performance problems
3737
3838To diagnose an app with performance problems, you'll enable
39- the performance overlay to look at the UI and GPU threads.
39+ the performance overlay to look at the UI and raster threads.
40+ (The raster thread was previously known as the GPU thread.)
4041Before you begin, you want to make sure that you're running in
4142[ profile mode] [ ] , and that you're not using an emulator.
4243For best results, you might choose the slowest device that
@@ -134,15 +135,15 @@ The following screenshot shows the performance overlay running
134135on the Flutter Gallery example:
135136
136137![ Screenshot of overlay showing zero jank] ({% asset tools/devtools/performance-overlay-green.png @path %})
137- <br >Performance overlay showing the GPU thread (top),
138+ <br >Performance overlay showing the raster thread (top),
138139and UI thread (bottom).<br >The vertical green bars
139140represent the current frame.
140141
141142## Interpreting the graphs
142143
143- The top graph shows the time spent by the GPU thread,
144- the bottom one graph shows the time spent by the
145- UI (CPU) thread.
144+ The top graph (marked "GPU") shows the time spent by
145+ the raster thread, the bottom one graph shows the time
146+ spent by the UI thread.
146147The white lines across the graphs show 16ms increments
147148along the vertical axis; if the graph ever goes over one
148149of these lines then you are running at less than 60Hz.
@@ -166,7 +167,7 @@ the scene is too complicated to render quickly.
166167![ Screenshot of performance overlay showing jank with red bars] ({% asset tools/devtools/performance-overlay-jank.png @path %})
167168<br >The vertical red bars indicate that the current frame is
168169expensive to both render and paint.<br >When both graphs
169- display red, start by diagnosing the UI thread (Dart VM) .
170+ display red, start by diagnosing the UI thread.
170171
171172## Flutter's threads
172173
@@ -190,24 +191,28 @@ on other threads.
190191 Flutter's framework on your app's behalf.
191192 When your app creates and displays a scene, the UI thread creates
192193 a _layer tree_, a lightweight object containing device-agnostic
193- painting commands, and sends the layer tree to the GPU thread to
194+ painting commands, and sends the layer tree to the raster thread to
194195 be rendered on the device. _Don't block this thread!_
195196 Shown in the bottom row of the performance overlay.
196197
197- <dt markdown =" 1 " >**GPU thread**</dt >
198- <dd markdown =" 1 " >The GPU thread takes the layer tree and displays
198+ <dt markdown =" 1 " >**Raster thread** (previously known as the GPU thread) </dt >
199+ <dd markdown =" 1 " >The raster thread takes the layer tree and displays
199200 it by talking to the GPU (graphic processing unit).
200- You cannot directly access the GPU thread or its data but,
201+ You cannot directly access the raster thread or its data but,
201202 if this thread is slow, it's a result of something you've done
202- in the Dart code. Skia, the graphics library, runs on this thread,
203- which is sometimes called the _rasterizer_ thread.
203+ in the Dart code. Skia, the graphics library, runs on this thread.
204204 Shown in the top row of the performance overlay.
205+ This thread was previously known as the "GPU thread" because it
206+ rasterizes for the GPU. But it is running on the CPU. We renamed it
207+ to "raster thread" because many developers wrongly (but understandably)
208+ assumed the thread runs on the GPU unit.
205209
206- <dt markdown =" 1 " >**I/O** thread</dt >
210+ <dt markdown =" 1 " >**I/O thread** </dt >
207211<dd markdown =" 1 " >Performs expensive tasks (mostly I/O) that would
208- otherwise block either the UI or GPU threads.
212+ otherwise block either the UI or raster threads.
209213 This thread is not shown in the performance overlay.
210-
214+ </dl >
215+
211216For links to more information and videos,
212217see [ The Framework architecture] [ ] on the
213218[ GitHub wiki] [ ] , and the community article,
@@ -268,11 +273,11 @@ can be said here?
268273## Identifying problems in the GPU graph
269274
270275Sometimes a scene results in a layer tree that is easy to construct,
271- but expensive to render on the GPU thread. When this happens,
276+ but expensive to render on the raster thread. When this happens,
272277the UI graph has no red, but the GPU graph shows red.
273278In this case, you’ll need to figure out what your code is doing
274279that is causing rendering code to be slow. Specific kinds of workloads
275- are more difficult for the GPU. They might involve unnecessary calls
280+ are more difficult for the GPU. They might involve unnecessary calls
276281to [ ` saveLayer ` ] [ ] , intersecting opacities with multiple objects,
277282and clips or shadows in specific situations.
278283
0 commit comments