Upgrade to Pro — share decks privately, control downloads, hide ads and more …

CodeFest 2019. Дмитрий Виноградов (Axel Springe...

CodeFest 2019. Дмитрий Виноградов (Axel Springer) — Android. Производительность в Android-приложениях

Я расскажу об инструментах, которые помогут вам повысить производительность ваших Android-приложений. Поговорим о памяти, CPU, сетевых запросах, энергопотреблении, размере APK и скорости UI.

CodeFest

April 06, 2019
Tweet

More Decks by CodeFest

Other Decks in Technology

Transcript

  1. • Performance • Android Studio Profiler • CPU • Memory

    • Network • Energy • GPU • APK Analyzer • Tips
  2. Performance is important • Happy User • Google Play Reviews

    • Google Play Search and Recommendation
  3. • Performance • Android Studio Profiler • CPU • Memory

    • Network • Energy • GPU • APK Analyzer • Tips
  4. • Performance • Android Studio Profiler • CPU • Memory

    • Network • Energy • GPU • APK Analyzer • Tips
  5. Recording Configurations 1. Sample Java Methods 2. Trace Java Methods

    3. Sample C/C++ Functions 4. Trace System Calls
  6. • Performance • Android Studio Profiler • CPU • Memory

    • Network • Energy • GPU • APK Analyzer • Tips
  7. • Performance • Android Studio Profiler • CPU • Memory

    • Network • Energy • GPU • APK Analyzer • Tips
  8. • Performance • Android Studio Profiler • CPU • Memory

    • Network • Energy • GPU • APK Analyzer • Tips
  9. • Performance • Android Studio Profiler • CPU • Memory

    • Network • Energy • GPU • APK Analyzer • Tips
  10. • Performance • Android Studio Profiler • CPU • Memory

    • Network • Energy • GPU • APK Analyzer • Tips
  11. • Performance • Android Studio Profiler • CPU • Memory

    • Network • Energy • GPU • APK Analyzer • Tips
  12. UI • Flat view heirarchy • ViewStub • <include>, <merge>

    • DiffUtil, notifyItem* • Avoid excess backgrounds
  13. Memory • Avoid creating unnecessary objects (iteration, onDraw, onBindViewHolder) •

    Avoid memory leaks • SparseArray • ComponentCallbacks2
  14. Network and Energy • Push (FCM) • Cache • Different

    picture quality or resolution • WebP or compressed PNG and JPEG • WiFi and Charger if can wait • Network batching
  15. APK size • Remove unused code (minifyEnabled) and resources (shrinkResources)

    • Vector graphic and nine-patch • Multiple APKs or App Bundle