To minimize how long the compiler takes to compile your source code, you can:
Avoid compiling at
-O3gives maximum optimization in the code that is generated, but can result in longer build times to achieve such results.
Precompile header files to avoid repeated compilation.
Minimize the amount of debug information the compiler generates.
Guard against multiple inclusion of header files.
Use the restrict keyword if you can safely do so, to avoid the compiler having to do compile-time checks for pointer aliasing.
Try to keep the number of include paths to a minimum. If you have many include paths, ensure that the files you need to include most often exist in directories near the start of the include search path.
Try compiling a small number of large files instead of a large number of small files. The longer compilation time per file might be offset by less time spent unloading and unloading the compiler and obtaining licenses, particularly if using floating licenses.
Try compiling multiple files within a single invocation of
armcc(and single license checkout), instead of multiple
Floating licenses provide flexibility, but at the cost of speed. Consider obtaining node-locked licenses for your build machines, or some node-locked licenses locked to USB network cards that can be moved between machines as required.
Consider using or avoiding
--multifilecompilation, depending on the resulting build time.
In RVCT 4.0, if you compile with
--multifileis enabled by default.
In ARM Compiler 4.1 and later, the default is
--multifileregardless of the optimization level.
If you are using a makefile-based build environment, consider using a make tool that can apply some form of parallelism.
Consider your choice of operating system for cross-compilation. Linux generally gives better build speed than Windows, but there are general performance-tuning techniques you can apply on Windows that might help improve build times.
Introducing the ARM Compiler toolchain: