Setup dashboard to track compilation states (time, mem usage, etc)
Since excessive compile times / memory usage are battles we fight often on this project, is there any interest in setting up a dashboard to monitor these?
One possible approach would be to replace the CMake compiler variables with /usr/bin/time -v [actual compiler]
(using the program time
, not the shell built-in), which dumps a ton of handy info:
$ /usr/bin/time -v gcc -c t.cpp -o t
Command being timed: "gcc -c t.cpp -o t"
User time (seconds): 0.26
System time (seconds): 0.03
Percent of CPU this job got: 98%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:00.29
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 49680
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 0
Minor (reclaiming a frame) page faults: 12013
Voluntary context switches: 18
Involuntary context switches: 32
Swaps: 0
File system inputs: 0
File system outputs: 1352
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0
These would be collected in a directory, and then a CMake script could parse them in a test to ensure that they're all within some agreed upon limit, printing a summary of the most expensive steps. By setting some limits and testing against them, we can ensure that we'll compile on some minimum spec.