Skip to content

Draft: Reduce compilation time of OAI using ccache

Mikel Irazabal requested to merge ccache into develop

With ccache, the first time that the project is compiled, values are cached and reused in later builds. https://github.com/ccache/ccache

Example in 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz

time ./build_oai -c -C -w USRP --gNB --nrUE -P --ninja
real	13m17,521s
user	76m42,045s
sys	24m32,718s

Second time:

time ./build_oai -c -C -w USRP --gNB --nrUE -P --ninja
real	1m8,979s
user	3m16,003s
sys	0m51,521s

It also works if you change branches.


With the linker is more subtle, but it will link faster, specially when only one file is changed and recompiled using directly the make/ninja command. Some data on linkers:

https://github.com/rui314/mold

Note that (I think) that OAI cannot use mold due to licensing.

There are more tricks to accelerate the compilation time, but this two are fairly easy and all the people will certainly benefit. The largest potential is probably in the CI.

PS: Don't expect to see the same results as in my computer in all the builds/hardware platforms. A more realistic number will probably be 5x.

Edited by Robert Schmidt

Merge request reports

Loading