Reducing Compile Time in Eclipse with Parallel Build
Join the DZone community and get the full member experience.
Join For Freefeeling that building a project in eclipse (including kinetis design studio ) takes a long time? then probably the ‘parallel build’ option is not enabled in your project: using parallel build option reduces the needed time by factors. to give an example, to build a project with 56 source files takes 32 seconds without parallel build enabled:
with parallel build enabled this gets reduced down to less than 10 seconds:
:-)
‘parallel builds’ means that the ‘builder’ or make file does not compile one file after each other, but instead spawns a set of parallel builds. this is especially useful for host machines having multiple cores or cpu: such as each cpu then could do a compilation and balance the build load across all available cpus to cut the build time.
in eclipse codewarrior for mcu the parallel build is enabled by default (see “ using parallel builds: what is optimal? “). it is *not* enabled by default in standard eclipse kepler gnu arm eclipse projects or in the freescale kinetis design studio. as such, the build time needed for projects are taking a lot of time compared to codewarrior.
to speed up the build time, go to the project settings. i can enable ‘parallel build’ in the ‘behaviour’ tab of the c/c++ build group:
the number of ‘optimal jobs’ depends on the number of cpus of your machine (i have a machine with 8 cores).
the improvement of course depends on the number of cores and speed of your machine. three to five times improvements are typical on my machine.
there is only one possible drawback of the parallel build: if the project has a lot of compilation errors, the errors are reported ‘in parallel’ too: so if the project has many errors in many files, it is a good idea to turn parallel build off during the error fixing. apart of that: the parallel build option is great and i have turned it on whenever i can.
happy paralleling :-)
Published at DZone with permission of Erich Styger, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments