android performance

16
Android performance patterns Presented by ThuyPt

Upload: thuy-pham

Post on 08-Aug-2015

319 views

Category:

Technology


0 download

TRANSCRIPT

Android performance patterns

Presented by ThuyPt

About Android performance

● Performance is the most important● Design with performance?● Write faster, more performant App● Give the right resources, at the right time● Make fastest, smoothest, most awesome

experience

Rendering performance

● Draw view, transitions● How fast can draw activity and get it

updated?● All logic completed, all rendering done in

16ms or less

Good render

Bad render

Understanding overdraw

● Overdraw is term used to describe how many times a pixel has been re-draw in single frame of rendering

● Most case, pixel overdraw● GPU performance: show GPU Overdraw flag

Tool Profile GPU Rendering

● Developer option → Profile GPU Rendering on

● Graph for activate application, actionbar, toolbar, navigation performance

● Process swap buffer

Android UI and the GPU

● How does activity actually get drawn?● How does all XML and markup language turn

into pixels that user can see and understand ?

● Rasterization heavy: app with high performance

Invalidations, Layouts, Performance

● How much updating the visual properties of a view affects your performance?

● To improve measure, rendering pipeline● GPU View Update option to understand view

drawn● Hierachy viewer tool

Battery Performance

● What eating your mobile battery?● Write same action spent less battery● Battery historian: analyst networking battery,

GPS time, wakelock time● App in standby mode, wake lock, sleep…● Keep device awake

Memory Performance

● Garbage collection keep clean system● Understand memory manager● Memory manager tool

Performance Cost of Memory

● Working in managed memory doesn’t mean app is immune memory leaks.

● If start leaking memory, memory for app will smaller.

● Trace memory manager

Reference

● http://www.curious-creature.com/docs/android-performance-case-study-1.html

● https://www.udacity.com/course/ud825● Colt McAnlis G+