开发者

Optimizing Applications on Android NDK

开发者 https://www.devze.com 2023-03-12 17:33 出处:网络
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:

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

精彩评论

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