Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to speed up android ndk builds

We have a quite large C++ project that we build cross platform for Android and iOS. Xcode uses all cores when compiling and is much faster (4-5x depending on machine). Is there any way to improve the abysmal performance of the NDK? Any multi CPU options? We have precompiled headers, but it seems to me it is use of resources that is at fault.

So any tips or tricks to speed up android ndk project build times would be much appreciated!

like image 303
Alexp Avatar asked Sep 28 '12 12:09

Alexp


People also ask

Why does Android Studio take so long?

According to Android Studio's official system requirements, it takes at minimum 3 GB RAM to run smoothly. Honestly, its a lot and I believe that is the biggest cause of being it too slow all the time. The android developers are always complaining about the speed of Android Studio and how its slow ALL THE TIME.


1 Answers

You aren't required to use Android's build system for your compilation; the tools are all available for use within a Makefile (though you will need to take care to set up include paths, library paths, and compiler options).

Since you can create your own Makefile instead of using the default build scripts, you can use th -jN option to specify the number of simultaneous operations to perform.

like image 194
mah Avatar answered Sep 16 '22 16:09

mah