Android 高效编程注意事项
2010-03-22 21:13:00 来源:WEB开发网核心提示:}}}11, Avoid Float尽量避免使用float类型12,Android 高效编程注意事项(3), Some Sample Performance Numbers一些常用操作的占用时间相对比 较:操作 时间Add a local variable 1Add a member variable 4Call St
}
}
}
11, Avoid Float
尽量避免使用float类型
12, Some Sample Performance Numbers
一些常用操作的占用时间相对比 较:
操作 时间
Add a local variable 1
Add a member variable 4
Call String.length() 5
Call empty static native method 5
Call empty static method 12
Call empty virtual method 12.5
Call empty interface method 15
Call Iterator:next() on a HashMap 165
Call put() on a HashMap 600
Inflate 1 View from XML 22,000
Inflate 1 LinearLayout containing 1 TextView 25,000
Inflate 1 LinearLayout containing 6 View objects 100,000
Inflate 1 LinearLayout containing 6 TextView objects 135,000
Launch an empty activity 3,000,000
这 些时间相对值,值得我们好好的权衡哦,很有帮助。
更多精彩
赞助商链接