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:
How understand what components of the library take the most pressure?
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
精彩评论