开发者

Optimizing Applications on Android NDK

My application for Android NDK uses a single Open Source library in C. When it work, this library is too much load on the processor. Questions:

  1. How understand what components of the library take the most pressure?

  2. Is there开发者_如何学C any method to optimize? LOCAL_ARM_MODE: = arm greatly improves the performance?


There some tricks that can optimize your Android native code without too much efforts:

  • turn on level 3 compiler optimizations using -O3 switch
  • turn off string aliasing -fno-strict-aliasing (or you can turn it on if you are following the C-aliasing rules)
  • turn on floating-point instructions support -mfpu=vfp -mfloat-abi=softfp
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜