There is a tool called Ccache[1] to make the recompiling process faster, It is work to cache a compilation process. If you recompile a program the tool detects if some file has been changed or not, and then reuse the cached file for the unchanged one then recompile the process if changed file found. The first compilation time might run as usual, after the first compilation, the recompilation process will speeds up. CMIIW.
[1]
https://ccache.samba.org/ccache is a compiler cache. It speeds up recompilation by caching previous compilations and detecting when the same compilation is being done again. Supported languages are C, C++, Objective-C and Objective-C++.