Spotting compilation-time bottlenecks in order to compilation firewall efficiently [closed]
Asked Answered
H

0

3

I have this big C++ boostified project that takes ages to build so i'm trying to set up compilation firewalls. Now I could sprinkle pimpls or pure interfaces following my intuition but that doesn't seem very efficient... usually if i wanted to optimize a piece of code, I would run it through a profiler to see the bottlenecks which leads me to the following question: how do I see where are the bottlenecks in my compilation time?

All answers including trying alternate compilers are welcomed since code is cross-platform (crosses fingers!)

Thanks,

Halflength answered 8/4, 2013 at 7:18 Comment(8)
Possible duplicate of #2542773, #13560318Greerson
What have you tried? Most compilers I've worked without can output timing data.Abirritate
@ArneMertz Unless I missed something, both of your threads are quite coarse: they basically tell you the problem lies with parsing / templating but not exactly where (aka which classes) are an issueHalflength
@PeterWood Same kind of answer than Arne: I know that gcc has an option that basically shows that all the time is spent in the templates and that's it. Doesn't tell me which templates though. What are you refering to exactly?Halflength
@GurgHackpof no, the answers to those questions tell you about how you get the best profiling possible out of the compilers. The answer to your question can be found there: there's only a very broad profiling, not telling you exactly what the bottlenecks are, but giving you at least some hints.Greerson
I've written a script which goes through each header, and compiles it into an executable. This makes sure each header is self contained. It would be pretty simple to time it and work out what is taking longer.Abirritate
@PeterWood, that sounds like an interesting strategy. Would you care sharing your base script?Halflength
I wrote the script over a couple of hours, on company time, so I'm afraid I can't share it with you. It's part of our continuous integration scripts. It shouldn't be too hard to do yourself. If you can build your system from the command line already, you're most of the way there. It might not take you as long, I'm a very slow coder.Abirritate

© 2022 - 2024 — McMap. All rights reserved.