Decreasing build time
Technical Note 48554
Architectures:
All
Component:
compiler
Updated:
11/6/2015 1:05 PM
Introduction
For large projects, long build times can be a problem.
Solution hints
- Enable Parallel Build (Tools > Options > Project > Enable parallel build). On a multi-core computer, this leads to reduced build times. Note: This option is not available in older IAR Embedded Workbench releases.
- Make sure to use guard conditions in ALL header files. That is...
#ifndef __HFILE_H
.. and also check if it is possible to reduce the number of #includes in some of the source files. This could have great impact on build speed.
#define __HFILE_H
/* ... */
#endif
To see the size of each C-file with header files included, enable: Options > C/C++ Compiler > Preprocessor > "Preprocessor output to file". Then check the generated .i-file. Is it large? - Create pre-built libraries of "support"-code (BSPs, stacks etc) that does not have to be re-built with every modification of the application code.
- Disable the generation of compiler list files (Options > C/C++ Compiler > List).
- If some source files are located on a network drive (even if it is a RAM disk on the server), try copying the files to a "local" drive, and build there. If it goes faster, there might be a network filesystem (NFS/Samba) problem.
- If step 5 above helped (use a local drive), it may help to only place Object files and List files on a local drive. Modify Project > Options > General Options > Output. Configure "Object files" and "List files" to be placed locally.
- (General hints): See technical note 40547.
All product names are trademarks or registered trademarks of their respective owners.