Viladoman / CompileScore

Tools for profiling and visualizing C++ build times.
MIT License
464 stars 19 forks source link

Incredibuild (or other distributed compilation) support #33

Open mateberes opened 2 years ago

mateberes commented 2 years ago

Currently when I build a project with IB, CompileScore will only show the results from my machine, so I can choose between partial data, or a 7 hours build time. Is it possible to add Incredibuild support? Awesome plugin btw.

Viladoman commented 2 years ago

First of all, thanks for using the extension.

I am assuming you are using MSVC to build your project. In this case the method Microsoft has created to extract the build events is by capturing them at the OS level afaik. This means that while a build recording is happening, anything that MSVC will compile in your machine will be captured. This has the following traits:

With distributed builds, there are 2 problems that need to be solved:

For clang the solution should be easier, as the way it reports the profiling data is by generating a .json file next to the .obj file. This means that we should only need a way to migrate back that file from the helper machine.

Sorry for the bad news, but what I have done in the past for massive projects is to leverage the fact that usually those projects have a nice server infrastructure in the company. We can then perform a nightly/weekend full non distributed compilation on the servers and store the data in a shared folder. Then we can make the extension point to that location and have 'up to date' build data without doing any extra action. This also opens the door to have some nice telemetry data and even add alerts when big changes happen, or weekly reports with the hotspots that should be addressed.

If you are interested in that approach I would recommend checking the command line score generation wiki page.

I hope this helps. If you have any ideas on how to deal better with distributed builds I would be more than happy to listen.