Hi Bill,

Would it be possible to share the topic implementing your profiling code ?

By default, summing the time spent in each functions makes sens.

That said, it would also be nice to have the option of having detailed
trace info, coupled with convenient code like "message("START_PROFILING")
and message("STOP_PROFILING"), it would allow to get stats on a subset of
the configure step. Having stats per directory would also be nice.

Leveraging GUI like KCacheGrind [1] to visualize the profiling files could
also be an option.

Thanks
Jc

[1] http://kcachegrind.sourceforge.net/html/Shot3Large.html


On Tue, Apr 23, 2013 at 4:24 PM, Bill Hoffman <bill.hoff...@kitware.com>wrote:

> On 4/23/2013 3:50 PM, Volo Zyko wrote:
>
>> Hi all,
>>
>> We have a rather big project and use cmake for building it. At some
>> point our cmake scripts became very slow (around 4 minutes for single
>> cmake run). We are thinking now how to speed up it. Searching the web
>> and this list didn't give any results. It looks like there is no such
>> thing as profiler for cmake scripts. Am I right?
>>
>> What about adding such capability to cmake? It looks like cmake's trace
>> provides enough info for time profiling, the only thing that it lacks is
>> a time stamp. Below is a small patch that adds time stamp and nesting
>> level (to simplify building a stack trace) to each trace line. Would it
>> be possible to integrate this change to the main line or are there
>> better options for time profiling of cmake?
>>
>
> That's funny.  I was just playing around with adding a profile option. My
> approach was to sum up all the time spent in each function.  It does not
> have a call stack but, should give you an idea of where it is spending the
> bulk of the time.   I suppose you could post process the output of a trace
> with your change, but that would be more work.
>
> An example of my output on the ParaView project:
>
> 4.881 export
> 4.97701 vtk_wrap_python
> 5.15999 vtk_module_export
> 5.45701 VTK_WRAP_ClientServer
> 5.817 QT4_GET_MOC_FLAGS
> 6.159 vtk_module_impl
> 6.38601 pv_pre_wrap_vtk_mod_cs
> 7.08994 if
> 7.23499 vtk_add_python_wrapping
> 7.46001 QT4_WRAP_CPP
> 7.71494 configure_file
> 8.59399 vtk_module_config
> 8.904 pv_process_plugins
> 8.987 vtk_add_cs_wrapping
> 9.64503 set
> 11.654 try_compile
> 12.748 vtk_module_third_party
> 17.007 vtk_module_library
> 37.773 _vtk_module_config_recurse
> 112.788 include
> 158.092 add_subdirectory
>
> Also, thinking of adding some stats to number of times a variable is set
> and how many variables are used.
>
> -Bill
>
>
> --
>
> 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>
>



-- 
+1 919 869 8849
--

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

Reply via email to