[CMake] cmake script profiler
Kyle Heath
heathkh at gmail.com
Thu Apr 25 16:14:10 EDT 2013
Volo,
Thanks for sharing your cmake-profile-stats tool... I found it very useful.
With this tool and about ~10 minutes of tweaking, my configure phase runs
~4x faster!
@Bill: I hope similar profiling features will be included in a future
release!
Cheers,
Kyle
PS: I added a small extension to your script to print a cumulative summary
of time spent in each function. This helped me find the hotspots quickly.
I posted the modified script here:
https://code.google.com/p/cmake-profile-stats/issues/detail?id=1
On Wed, Apr 24, 2013 at 9:13 PM, Volo Zyko <volo.zyko at gmail.com> wrote:
> We have executables and libraries and a lot of custom targets (the project
> is organized so that we export headers during the build - not the best idea
> in the world). However, I finished (more or less) the script for building
> time stats from the cmake's trace and we (with my colleague) found the
> slowest part. In our cmake scripts we have a bunch of sub-projects which
> produce libraries and also we have an utility function with which we define
> dependencies between those sub-projects. Then we define executables and
> build a list of libraries in a right order (from more dependent to less
> dependent) using sub-project's dependencies. This list is necessary for
> linking the executables. So, it appears that the slowest part is the
> function that builds the list of libraries. Basically there is nothing
> wrong with that cmake function, it just intensively works with strings. :(
>
> And here is where I put my script:
> https://code.google.com/p/cmake-profile-stats/ Comments are welcome.
>
> Also it looks like there are few bugs in the trace functionality of cmake;
> especially how callstack changes when cmake process foreach and if/else
> calls. I just didn't investigate them and I cannot provide more details.
> Sorry.
>
> --
> Volo Zyko
>
> On Wed, Apr 24, 2013 at 10:14 PM, Bill Hoffman <bill.hoffman at kitware.com>wrote:
>
>> On 4/24/2013 3:07 PM, Volo Zyko wrote:
>>
>>> Hi,
>>>
>>> We use Makefiles on Linux and MacOS. Windows is not our target platform.
>>> From what we see Linux is the fastest. We made few attempts of building
>>> our project on Windows in VS but it was very-very slow and definitely
>>> cmake generates too many project files for VS. For us it was 500+
>>> projects in a workspace which is too much for Visual Studio. :(
>>>
>> Chances are you have too many high level targets in your project. What
>> types of targets do you have? Are they all executables and libraries or
>> are you using custom targets to do something? That might be a source of
>> your performance issues as well.
>>
>> -Bill
>>
>>
>> --
>> Bill Hoffman
>> Kitware, Inc.
>> 28 Corporate Drive
>> Clifton Park, NY 12065
>> bill.hoffman at kitware.com
>> http://www.kitware.com
>> 518 881-4905 (Direct)
>> 518 371-3971 x105
>> Fax (518) 371-4573
>>
>> --
>>
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at http://www.kitware.com/**
>> opensource/opensource.html<http://www.kitware.com/opensource/opensource.html>
>>
>> Please keep messages on-topic and check the CMake FAQ at:
>> http://www.cmake.org/Wiki/**CMake_FAQ<http://www.cmake.org/Wiki/CMake_FAQ>
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.cmake.org/mailman/**listinfo/cmake<http://www.cmake.org/mailman/listinfo/cmake>
>>
>
>
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130425/32daf04b/attachment.htm>
More information about the CMake
mailing list