Viladoman / CompileScore

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

Feature: exclusive time counts #32

Closed kamrann closed 1 year ago

kamrann commented 2 years ago

One thing that becomes clear quite quickly when analysing using CompileScore is the dependency on #include order, and how that has to be taken into account when interpreting results. By this I'm referring to the fact that a single header can have wildly different times in different contexts, due to the effect of include guards and what other headers have been included before it in one context vs another.

It seems like having an 'exclusive time' column for each header would be very useful for making it easier to identify the true compilation time offenders. So basically, the time that was spent compiling the header, minus the time spent within all its #includes. I'm not sure if the underlying compiler invocations can give you this information directly, but even if not it seems like you probably have the data you need to calculate it. Is this something you've considered?

Viladoman commented 2 years ago

I agree. I have in my todo list to add the extraction of self, self max, self min... for all sources and symbols. The information is there as I can compute the 'self' time on each timeline and aggregate the data. It is already kind of doing something similar when gathering the total include time.

Before being able to do that, I needed to update how I am storing the files to avoid having a massive binary with everything in it and choke the extension loader on big projects. I got that change in 1.7.0, now I should be able to add more data which will only be fetched when opening the extension window.

honkstar1 commented 1 year ago

Thanks for an amazing tool!!! Incredibly useful.

I would also love to see self time :-) The game I'm working on has header files that are 8000+ lines.. I want to know how much they cost themselves :-)

honkstar1 commented 1 year ago

I forked and added it in my depot.

Viladoman commented 1 year ago

Amazing!

Sorry for the late reply, We are shipping our game soon and I was planning on retaking this project after. I just checked your fork and I think overall the change makes sense.

I was also thinking that maybe we might also be interested in the Self Max. it is the new field I was planning on adding originally when this issue got opened, but I can also see value on the accumulated one too.

Thanks for taking the time to modify the project. Super appreciated!

honkstar1 commented 1 year ago

Yes, I'm sitting here trying to reduce the compile times of our Engine/Game and CompileScore has been extremely useful. I'm frequently jumping between accumulated inclusive and exclusive to find the most bang for the buck.

You've made an extremely useful tool.. well done!

(The next feature request from me would be to somehow have multiple compile scores available at the same time.. some sort of history in a dropdown or something.. I frequently jump between a full compilescore which takes me 30-40 minutes to produce and iterating on individual files)

Viladoman commented 1 year ago

Thanks all, this is now present on version 1.8.1+. Including Self Max, Self Accumulated and Self Max Location.