[cmake-developers] Profile Cmake scripts
Dimitar Yordanov
domidimi at gmail.com
Sun Dec 27 16:04:14 EST 2015
2015-12-27 21:05 GMT+01:00 Alexander Neundorf <neundorf at kde.org>:
>
> On Sunday, December 27, 2015 18:40:27 Dimitar Yordanov wrote:
>
> > Hi all,
>
> >
>
> > I was searching for a way to profile CMake scripts in order to find
>
> > bottlenecks and possibilities to improve performance. I found out that
>
> > someone already invested time on that [1] providing a minimal solution. The
>
> > idea behind it is to use the cmake "--trace" option and to output a time
>
> > stamp and a stack depth with each executed command. The trace log is
>
> > afterwards used by a Python script, which transforms it into a more
>
> > readable format.
>
>
>
> I actually simply used valgrind/callgrind and got useful results from that.
I agree with you. Running valgrind directly on the cmake binary
provides useful information: I can see which internal cmake functions
are used the most and consume most of the time.
Nevertheless, I think it would be useful to have a higher level
overview. E.g. to see if there are some issues with the scripts
themselves that I use in my project ...
> Usually you see mostly string handling related functions.
malloc and free are on the top of what I see for a random project used
mostly by std::string. Maybe we can optimize something here too?
Regards,
Dimitar
More information about the cmake-developers
mailing list