execution optimizations
Several optimizations should be applied to improve performance and save hardware resources:
-
RAM disk
When compiling the code, output files should be created on a temporary RAM disk. Once mounted, the target destination (i.e. the RAM disk) can be specified for themake
simply by defining theBUILDDIR
option (e.g.make all BUILDDIR=/path/to/build/directory
). RAM disks can be rather small (~50 MB per target) and can be discarded immediately after the build result has been acquired. The CI script should still be able to fallback to a "normal" output path (i.e. not a RAM disk), if no RAM disk could be created due to insufficient memory available. -
nice jobs
When compiling the code, especially when executing the massive parameter verification, building thousands of targets, resources of the executing platform should be utilized as efficient as possible. Therefore the two aspects, CPU load and memory load shall be evaluated as follows:- Start a first process, but with low priority (cf.
nice
). This initial process is executed regardless of the current system load, so that other users can not completely starve execution of the CI script. - Wait a few seconds for the build process to ramp up (maybe some event-driven approach is also possible?).
- Evaluate current system load and decide whether another job can be started:
- unused CPU threads left and enough (needs to be evaluated, perhaps the maximum over all already started build processes) memory available:
Start another build process; GOTO 2. - not enough CPU or memory resources available:
Wait some time; GOTO 3.
- unused CPU threads left and enough (needs to be evaluated, perhaps the maximum over all already started build processes) memory available:
- Start a first process, but with low priority (cf.