Android performance: UI (Google I/O '17)

Android Developers · 42K views · 2017 · 38:59

Open on YouTube

Software performance & optimizationSoftware (other)talk

Why Stack Overflow recommends it

Stack Overflow users link it when explaining the split between the UI thread and the render thread and why frames drop.

Recommended by 2 people across 2 different months, 2012 to 2019.

What it is

A Google I/O 2017 talk from the Android team explaining how Android's rendering architecture displays UIs and how that affects performance. It also covers techniques for diagnosing app performance problems such as jank and frame drops.

What people said

Recommends Morrison Chang · 2012-06 · Stack Overflow · on “FPS testing in android application”

As mention by Guykun and kcoppock, if you are only using the View widgets or Canvas you normally don't look for FPS to determine visual performance. As you don't mention what you are doing other than 'not a game' you may want to review how Android does drawing. [LINK] Most of the performance issues come from doing stuff on the UI thread. Use Strict Mode for finding problems. [LINK] Also use the tools to find performance hot spots: [LINK] [LINK] [LINK] And if you want more details of what's going on under the hood see the Google IO session on what they did for Hardware Accelerated Rendering Google I/O 2011: Accelerated Android Rendering [LINK] Google has done additional work on UI performance

Recommends Hassan · 2018-02 · Stack Overflow · on “RenderThread vs UI thread”

Render thread as it name explains just do the rendering onDraw() , UI Thread do onMeasure() , onLayout() , etc... the concept of that separation is to do the hard work of measuring and calculating the other things without blocking the rendering that leads to smooth fps watch this [this video]

Cites Mertcan Özdemir · 2019-03 · Stack Overflow · on “Why can't UI thread and Render thread run at the same time?”

I am a mediocore android developer for years. I like android but there's a big problem; frame drops. Even the most powerful ones can stutter so frequently while IOS devices can run at constant 60fps. I just can't understand why. I want to know it. So first thing i did was watching an I/O presentation about performance. And i didn't really understand one thing. Why can't ui and render thread run at the same time ? Yeah i know the basics like render thread can't know what to render while ui thread is doing it's thing but why can't render thread render the frame before? You can see the video here: [this video] And here's a diagram what am i asking for: You get the idea. I don't know about low level