Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Android性能优化.md #72

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Part1/Android/Android性能优化.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ onTrimMemory()方法还有很多种其他类型的回调,可以在手机内存

###是有优化过的数据集合
Android提供了一系列优化过后的数据集合工具类,如SparseArray、SparseBooleanArray、LongSparseArray,使用这些API可以让我们的程序更加高效。HashMap工具类会相对比较低效,因为它需要为每一个键值对都提供一个对象入口,而SparseArray就避免掉了基本数据类型转换成对象数据类型的时间。
[看如何利用SparseArray和ArrayMap替代HashMap提高内存效率](http://blog.csdn.net/u010687392/article/details/47809295)

###知晓内存的开支情况
* 使用枚举通常会比使用静态常量消耗两倍以上的内存,尽可能不使用枚举
Expand Down