|
1 | 1 | page.title=Designing for Performance |
2 | 2 | @jd:body |
3 | 3 |
|
| 4 | +<div id="qv-wrapper"> |
| 5 | +<div id="qv"> |
| 6 | + |
| 7 | +<h2>In this document</h2> |
| 8 | +<ol> |
| 9 | + <li><a href="#intro">Introduction</a></li> |
| 10 | + <li><a href="#optimize_judiciously">Optimize Judiciously</a></li> |
| 11 | + <li><a href="#object_creation">Avoid Creating Objects</a></li> |
| 12 | + <li><a href="#myths">Performance Myths</a></li> |
| 13 | + <li><a href="#prefer_static">Prefer Static Over Virtual</a></li> |
| 14 | + <li><a href="#internal_get_set">Avoid Internal Getters/Setters</a></li> |
| 15 | + <li><a href="#use_final">Use Static Final For Constants</a></li> |
| 16 | + <li><a href="#foreach">Use Enhanced For Loop Syntax</a></li> |
| 17 | + <li><a href="#avoid_enums">Avoid Enums Where You Only Need Ints</a></li> |
| 18 | + <li><a href="#package_inner">Use Package Scope with Inner Classes</a></li> |
| 19 | + <li><a href="#avoidfloat">Use Floating-Point Judiciously</a> </li> |
| 20 | + <li><a href="#library">Know And Use The Libraries</a></li> |
| 21 | + <li><a href="#native_methods">Use Native Methods Judiciously</a></li> |
| 22 | + <li><a href="#closing_notes">Closing Notes</a></li> |
| 23 | +</ol> |
| 24 | + |
| 25 | +</div> |
| 26 | +</div> |
| 27 | + |
4 | 28 | <p>An Android application will run on a mobile device with limited computing |
5 | 29 | power and storage, and constrained battery life. Because of |
6 | 30 | this, it should be <em>efficient</em>. Battery life is one reason you might |
7 | 31 | want to optimize your app even if it already seems to run "fast enough". |
8 | 32 | Battery life is important to users, and Android's battery usage breakdown |
9 | 33 | means users will know if your app is responsible draining their battery.</p> |
10 | 34 |
|
11 | | -<p>This document covers these topics: </p> |
12 | | -<ul> |
13 | | - <li><a href="#intro">Introduction</a></li> |
14 | | - <li><a href="#optimize_judiciously">Optimize Judiciously</a></li> |
15 | | - <li><a href="#object_creation">Avoid Creating Objects</a></li> |
16 | | - <li><a href="#myths">Performance Myths</a></li> |
17 | | - <li><a href="#prefer_static">Prefer Static Over Virtual</a></li> |
18 | | - <li><a href="#internal_get_set">Avoid Internal Getters/Setters</a></li> |
19 | | - <li><a href="#use_final">Use Static Final For Constants</a></li> |
20 | | - <li><a href="#foreach">Use Enhanced For Loop Syntax</a></li> |
21 | | - <li><a href="#avoid_enums">Avoid Enums Where You Only Need Ints</a></li> |
22 | | - <li><a href="#package_inner">Use Package Scope with Inner Classes</a></li> |
23 | | - <li><a href="#avoidfloat">Use Floating-Point Judiciously</a> </li> |
24 | | - <li><a href="#library">Know And Use The Libraries</a></li> |
25 | | - <li><a href="#native_methods">Use Native Methods Judiciously</a></li> |
26 | | - <li><a href="#closing_notes">Closing Notes</a></li> |
27 | | -</ul> |
28 | | - |
29 | 35 | <p>Note that although this document primarily covers micro-optimizations, |
30 | 36 | these will almost never make or break your software. Choosing the right |
31 | 37 | algorithms and data structures should always be your priority, but is |
|
0 commit comments