Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2087962
  • 博文数量: 413
  • 博客积分: 10926
  • 博客等级: 上将
  • 技术积分: 3862
  • 用 户 组: 普通用户
  • 注册时间: 2006-01-09 18:14
文章分类

全部博文(413)

文章存档

2015年(5)

2014年(1)

2013年(5)

2012年(6)

2011年(138)

2010年(85)

2009年(42)

2008年(46)

2007年(26)

2006年(59)

分类: LINUX

2011-03-09 18:43:33

  1. Ref
    http://developer.android.com/guide/practices/design/performance.html
    http://developer.android.com/resources/articles/zipalign.html
  2. Tips
    • Don't do work that you don't need to do.
    • Avoid creating unnecessary objects
      Allocating memory is always very expensive
    • Slice up multidimensional arrays into parallel single one-dimension arrays:
      - An array of ints is a much better than an array of Integers,
      - Multiple parallel arrays are generally much better than a single array of custom objects
    • Prefer static over virtual
          If you don't need to access an object's fields, make your method static.
    • Avoid internal getters/setters
      Within a class you should always access fields directly, virtual method calls are expensive
    • Use static final for constants
    • Use enhanced for loop syntax
      use for (Type elem : array)
    • Consider Package Instead of Private Access if the field or method need to be accessed by Private Inner Classes access
    • Use floating-point judiciously
      Floating-point is about 2x slower than integer on Android devices
    • Use native methods judiciously
      Native code isn't necessarily more efficient than Java.
  3. xxx
阅读(535) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~