Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Android performance

3,106 views

Published on

Android Performance talk from MobiDevDay 2013

Published in: Technology
  • Be the first to comment

Android performance

  1. 1. Godfrey Nolan
  2. 2.      Some Web History Android Performance Tips Android SDK Tools Other Tools Resources
  3. 3. Program Optimization Rules: Rule 1: Don't do it. Rule 2 (for experts only!): Don’t do it yet
  4. 4.  Web Metric 95% of pages returned in a second or less    Optimize the slowest, most visited pages 10x performance increases not unusual Wash, rinse, repeat
  5. 5.     No metric yet No log files No time-taken token Ideally… Good load testing tool with activity time Continuous Integration plugin available
  6. 6. Avoid creating unnecessary objects or memory allocations Avoid internal getters/setters i = mCount not i = getCount() Use Static/Final where appropriate static final int intVal = 42; not static int intVal = 42; Use floats judiciously NDK calls Views are expensive, flatten layouts, don’t inflate Use standard libraries, enhanced for loop
  7. 7.      Streamline your UI Shrink your APK Identify memory leakage issues Profile your code Measure performance in the field
  8. 8. Calabash Timings Run 1 Run 2 Run 3 LinearLayout 3m42s 3m10s 3m16s RelativeLayout 3m16s 3m7s 3m8s
  9. 9. Calabash Timings Run 1 Run 2 Run 3 No Proguard 4m15s 4m7s 3m56s Proguard 4m13s 3m47s 3m40s
  10. 10. Calabash Timings Run 1 Run 2 Run 3 Before heap 4m57s 5m39s 4m55s After heap 4m15s 4m7s 3m56s
  11. 11.  SQLite Explain plan is your friend Use Indexes Carefully craft your SQL  Web Services Use log files to identify issues
  12. 12.  DDMS System Info Heap Usage w/MAT Memory Allocation Threads  Traceview Method Profiling within DDMS Precise profiling using trace API        Systrace Lint Hierarchy Viewer StrictMode Unix commands ARO Crittercism
  13. 13.  Leverage Unix performance commands top 10 dump meminfo <pid> procrank
  14. 14. http://developer.android.com/training/articles/perf-tips.html http://www.youtube.com/watch?v=UApv-ZMJ51g http://android-developers.blogspot.com/2009/11/optimize-your-layouts.html http://developer.android.com/tools/debugging/debugging-ui.html http://www.javaperformancetuning.com/tips/rawtips.shtml http://software.intel.com/en-us/articles/performance-debugging-of-androidapplications/ http://developer.android.com/tools/debugging/debugging-tracing.html http://android-developers.blogspot.com/2009_02_01_archive.html http://bon-app-etit.blogspot.com/2013/03/using-traceview-for-betterperformance.html http://www.sqlite.org/eqp.html http://www.eclipse.org/mat/downloads.php http://imgoptim.com http://developer.att.com/developer/forward.jsp?passedItemId=13800072 http://www.devahead.com/blog/2011/12/coding-for-performance-and-avoidinggarbage-collection-in-android/
  15. 15.   godfrey@riis.com @riisllc

×