文章目录
做了这么久性能相关的工作,也接触了不少模块,说实话要做好性能这一块,真心不容易.为什么这么说? 是因为需要接触的知识实在是太多了, Android 是一个整体,牵一发而动全身,不是说只懂一个模块就可以做好.
在学习的过程中,除了看源码,我还接触到了很多互联网上已有的知识,各位前辈们,将他们的知识和经验倾囊相授,让我少走了很多弯路. 我在自己的笔记里面存了很多很优秀的技术文章和技术文档,现在我决定将这些放到网上,让每一个想进入 Android 系统开发和优化这个领域的人,能通过阅读这篇文章,快速入门. 同时也算是我对知识的一个梳理,查漏补缺,终身学习.
这篇文章记录了 Android 性能优化所必须掌握的知识,涵盖性能优化相关的方方面面(当然如果读者同学你也有很棒的私藏文章,也可以加入到这篇文章里面).
优化心得和经验
- [系列视频] Android Performance Patterns : https://www.youtube.com/playlist?list=PLWz5rJ2EKKc9CBxr3BVjPTPoDPLdPIFCE
- 给 App 提速:Android 性能优化总结 : http://android.jobbole.com/81944/
- 移动端性能监控方案 Hertz : https://tech.meituan.com/hertz.html
- Android 性能优化后续 : http://androidperformance.com/2015/03/31/android-performance-case-study-follow-up.html
- Android性能优化之虚拟机调优 : http://weishu.me/2016/12/23/dive-into-android-optimize-vm-heap/
- [译]Android UI 性能优化 : https://zhuanlan.zhihu.com/p/27065828
响应速度
- Optimizing Boot Times : https://source.android.com/devices/tech/perf/boot-times
- Android 中如何计算 App 的启动时间 : http://androidperformance.com/2015/12/31/How-to-calculation-android-app-lunch-time.html
流畅度
- Evaluating Performance : https://source.android.com/devices/tech/debug/eval_perf
- Understanding Systrace : https://source.android.com/devices/tech/debug/systrace
- Using ftrace : https://source.android.com/devices/tech/debug/ftrace
- Identifying Capacity-Related Jank : https://source.android.com/devices/tech/debug/jank_capacity
- Identifying Jitter-Related Jank : https://source.android.com/devices/tech/debug/jank_jitter
- 那些年我们用过的显示性能指标 : http://blog.csdn.net/tencent_bugly/article/details/51354517
内存
- Low RAM Configuration : https://source.android.com/devices/tech/perf/low-ram
- Linux Swap 与 Zram 详解 : http://www.tinylab.cn/linux-swap-and-zramfs/#zram-
- Android 加载不同 DPI 资源与内存消耗间的关系 : http://www.tinylab.cn/android-loading-a-different-relationship-between-dpi-and-memory-consumption-of-resources/
- ZRAM SWAP 内存管理讲解 : https://nekosc.com/technology/zram.html
- Android OOM 案例分析 : https://tech.meituan.com/oom_analysis.html
- Android 代码内存优化建议-Android 资源篇 : http://androidperformance.com/2015/07/20/Android-Performance-Memory-AndroidResource.html
- Android 代码内存优化建议-Android 官方篇 : http://androidperformance.com/2015/07/20/Android-Performance-Memory-Google.html
- Android 代码内存优化建议-Java 官方篇 : http://androidperformance.com/2015/07/20/Android-Performance-Memory-Java.html
- Android 内存优化之一:MAT 使用入门 : http://androidperformance.com/2015/04/11/AndroidMemory-Usage-Of-MAT.html
- Android 内存优化之二:MAT 使用进阶 : http://androidperformance.com/2015/04/11/AndroidMemory-Usage-Of-MAT-Pro.html
- Android 内存优化之三:打开 MAT 中的 Bitmap 原图 : http://androidperformance.com/2015/04/11/AndroidMemory-Open-Bitmap-Object-In-MAT.html
- Android 代码内存优化建议-OnTrimMemory 优化 : http://androidperformance.com/2015/07/20/Android-Performance-Memory-onTrimMemory.html
- Android LowMemoryKiller原理分析 : http://gityuan.com/2016/09/17/android-lowmemorykiller/
- Android 匿名共享内存(Ashmem)原理 : https://juejin.im/post/59e818bb6fb9a044fd10de38
图形栈
- Android 硬件加速原理与实现简介 :https://tech.meituan.com/hardware-accelerate.html
- Android6.0 显示系统(一) Surface 创建: http://blog.csdn.net/kc58236582/article/details/52670528
- Android6.0 显示系统(二) SurfaceFlinger 创建 Surface :http://blog.csdn.net/kc58236582/article/details/52680288
- Android6.0 显示系统(三) 管理图像缓冲区 : http://blog.csdn.net/kc58236582/article/details/52681363
- Android6.0 显示系统(五) SurfaceFlinger 服务 : http://blog.csdn.net/kc58236582/article/details/52763534
- Android6.0 显示系统(六) 图像的输出过程 : http://blog.csdn.net/kc58236582/article/details/52778333
- Android6.0 SurfaceControl 分析(一)SurfaceControl创建&使用 Surface创建&使用 : http://blog.csdn.net/kc58236582/article/details/64918810
- Android6.0 SurfaceControl 分析(二)SurfaceControl和SurfaceFlinger通信
- Android6.0 VSync 信号如何到用户进程 : http://blog.csdn.net/kc58236582/article/details/65445141
- Android 图形系统概述 : http://gityuan.com/2017/02/05/graphic_arch/
- Choreographer 原理 : http://gityuan.com/2017/02/25/choreographer/
- SurfaceFlinger 启动篇 : http://gityuan.com/2017/02/11/surface_flinger/
- SurfaceFlinger 绘图篇 : http://gityuan.com/2017/02/18/surface_flinger_2/
- [HWUI]Android 应用程序 UI 硬件加速渲染技术简要介绍和学习计划 : http://blog.csdn.net/luoshengyang/article/details/45601143
- [HWUI]Android 应用程序 UI 硬件加速渲染环境初始化过程分析 : http://blog.csdn.net/luoshengyang/article/details/45769759
- [HWUI]Android 应用程序 UI 硬件加速渲染的预加载资源地图集服务(Asset Atlas Service)分析 : http://blog.csdn.net/luoshengyang/article/details/45831269
- [HWUI]Android 应用程序 UI 硬件加速渲染的 Display List 构建过程分析 : http://blog.csdn.net/luoshengyang/article/details/45943255
- [HWUI]Android 应用程序 UI 硬件加速渲染的 Display List 渲染过程分析 : http://blog.csdn.net/luoshengyang/article/details/46281499
- [HWUI]Android 应用程序 UI 硬件加速渲染的动画执行过程分析 : http://blog.csdn.net/luoshengyang/article/details/46449677
虚拟机
- ART and Dalvik : https://source.android.com/devices/tech/dalvik/
- Android 8.0 ART Improvements : https://source.android.com/devices/tech/dalvik/improvements
- Dalvik bytecode : https://source.android.com/devices/tech/dalvik/dalvik-bytecode
- Dalvik Executable format : https://source.android.com/devices/tech/dalvik/dex-format
- Dalvik Executable instruction formats : https://source.android.com/devices/tech/dalvik/instruction-formats
- Constraints : https://source.android.com/devices/tech/dalvik/constraints
- Configuring ART : https://source.android.com/devices/tech/dalvik/configure
- Debugging ART Garbage Collection : https://source.android.com/devices/tech/dalvik/gc-debug
- Implementing ART Just-In-Time (JIT) Compiler : https://source.android.com/devices/tech/dalvik/jit-compiler
系统框架
- Task Snapshots :https://source.android.com/devices/tech/perf/task-snapshots
- Android Input 子系统:Input 进程的创建,监听线程的启动 : https://zhuanlan.zhihu.com/p/29152319
- Android Input 子系统:Input 事件的产生、读取和分发,InputReader、InputDispatcher : https://zhuanlan.zhihu.com/p/29386642
- EventHub 与设备、Input 事件的交互 : https://zhuanlan.zhihu.com/p/30127752
- Android 消息机制,从Java 层到 Native 层剖析 : https://zhuanlan.zhihu.com/p/29929031
- 理解 Android Binder 机制(1/3):驱动篇 : http://qiangbo.space/2017-01-15/AndroidAnatomy_Binder_Driver/
- 理解 Android Binder 机制(2/3):C++ 层 : http://qiangbo.space/2017-02-12/AndroidAnatomy_Binder_CPP/
- 理解 Android Binder 机制(3/3):Java 层 : http://qiangbo.space/2017-03-15/AndroidAnatomy_Binder_Java/
- Android Bander 设计与实现 - 设计篇 : http://blog.csdn.net/universus/article/details/6211589
- 四大组件之综述 : http://gityuan.com/2017/05/19/ams-abstract/
- 四大组件之 ActivityRecord : http://gityuan.com/2017/06/11/activity_record/
- 四大组件之 ContentProviderRecord : http://gityuan.com/2017/06/04/content_provider_record/
- 四大组件之 BroadcastRecord : http://gityuan.com/2017/06/03/broadcast_record/
- 四大组件之 ServiceRecord : http://gityuan.com/2017/05/25/service_record/
- 简述 Activity 与 Window 关系 : http://gityuan.com/2017/04/16/activity-with-window/
- 理解 Android Context : http://gityuan.com/2017/04/09/android_context/
- 理解 Application 创建过程 : http://gityuan.com/2017/04/02/android-application/
- 以 Window 视角来看 startActivity : http://gityuan.com/2017/01/22/start-activity-wms/
- WMS—启动窗口(StartingWindow) : http://gityuan.com/2017/01/15/wms_starting_window/
- WMS—启动过程 : http://gityuan.com/2017/01/08/windowmanger/
进程管理
- cpuset : https://www.kernel.org/doc/Documentation/cgroup-v1/cpusets.txt
- cgroup : https://www.kernel.org/doc/Documentation/cgroup-v1/cgroups.txt
- Android 进程调度之 adj 算法 http://gityuan.com/2016/08/07/android-adj/
- Linux 进程管理(一) http://gityuan.com/2017/07/30/linux-process/
- Linux 进程管理(二)–fork http://gityuan.com/2017/08/05/linux-process-fork/
- Linux 进程 pid 分配法 http://gityuan.com/2017/08/06/linux_process_pid/
- [收费培训视频] 打通 Linux 脉络系列:进程、线程和调度 : http://edu.csdn.net/course/detail/5995
- Android 系统中的进程管理:进程的创建 : http://qiangbo.space/2016-10-10/AndroidAnatomy_Process_Creation/
- Android 系统中的进程管理:进程的优先级 : http://qiangbo.space/2016-11-23/AndroidAnatomy_Process_OomAdj/
- Android 系统中的进程管理:内存的回收 : http://qiangbo.space/2016-12-08/AndroidAnatomy_Process_Recycle/
- Android 系统启动:init 进程与 init 语言 : http://qiangbo.space/2017-01-28/AndroidAnatomy_Init/
调试工具
- 另一个 Android 性能剖析工具——simpleperf : https://zhuanlan.zhihu.com/p/25277481
- 如何调试 Android Framework : http://weishu.me/2016/05/30/how-to-debug-android-framework/
- 如何调试 Android Native Framework : http://weishu.me/2017/01/14/how-to-debug-android-native-framework-source/
- Catapult : https://catapult.gsrc.io/README.md
- 手把手教你使用Systrace(一): https://zhuanlan.zhihu.com/p/27331842
- 手把手教你使用Systrace(二)——锁优化
: https://zhuanlan.zhihu.com/p/27535205
硬件相关
- Flash Wear Management in Android Automotive : https://source.android.com/devices/tech/perf/flash-wear
- Cortex-A75 和 Cortex-A55 : http://www.10tiao.com/html/431/201706/2650236929/1.html
- CPU Utilization is Wrong : http://www.brendangregg.com/blog/2017-05-09/cpu-utilization-is-wrong.html
编程语言
Kernel
- 内核探索:Regmap 框架:简化慢速 I/O 接口优化性能 http://www.tinylab.cn/kernel-explore-regmap-framework/
- 嵌入式 Linux 启动时间优化 http://www.tinylab.cn/elinux-org-boot-time-optimization/
我辈楷模
- 我到底有多么努力 : https://mp.weixin.qq.com/s?__biz=MzU3ODAxNDcwNQ==&mid=2247484147&idx=1&sn=cd5f8fead3bcaac2d22a3dd699d2e79f&chksm=fd7a9e6dca0d177b27095d3d12720e83ba1638028799a89a8879929c1ad442529a62a46c5fe3&mpshare=1&scene=1&srcid=1027hi7FsUIG3AirEiJg198C#rd
- 工作以来的一些感悟 : https://zhuanlan.zhihu.com/zmywly8866/20711335
- 如何自学Android?https://zhuanlan.zhihu.com/p/20708611
转载出处:http://androidperformance.com/2017/10/19/Android-performance-optimization-skills-and-tools.html