android ccache

http://blog.chinaunix.net/uid-26973277-id-3277493.html

看了embedded android发现这个ccache的使用方式,可以加速我们c与c++的编译速度原理就是中间文件的一个缓存,是同一个.o文件的话就省去再次编译的速度。

介于android中c与c++文件数量能占到刚不到一半,所以这个速度还是能省下很多的。

看到原理大概也就是知道这个东西第一次编译是没有效果的,只有开启ccache后编译一次后就会有效果。
使用方式:

添加环境变量:

 1.$ export USE_CCACHE=1

 #建立缓存目录 

 2.$ export CCACHE_DIR=~/.ccache

设置缓存大小:

3.$cd android/

4.$prebuilt/linux-x86/ccache/ccache -M 20G

You can watch ccache being used by doing the following:

$ watch -n1 -d prebuilt/linux-x86/ccache/ccache -s


http://blog.csdn.net/chb2000/article/details/7217513


Setting up ccache

You can optionally tell the build to use the ccache compilation tool.Ccache acts as a compiler cache that can be used to speed-up rebuilds.This works very well if you do "make clean" often, or if you frequentlyswitch between different build products.

Put the following in your .bashrc or equivalent.

export USE_CCACHE=1

By default the cache will be stored in ~/.ccache.If your home directory is on NFS or some other non-local filesystem,you will want to specify the directory in your .bashrc as well.

export CCACHE_DIR=<path-to-your-cache-directory>

The suggested cache size is 50-100GB.You will need to run the following command once you have downloadedthe source code.

prebuilt/linux-x86/ccache/ccache -M 50G

This setting is stored in the CCACHE_DIR and is persistent.


你可能感兴趣的:(android ccache)