<div dir="ltr">Hi Bill,<div><br></div><div>Would it be possible to share the topic implementing your profiling code ?<div><div><br></div><div>By default, summing the time spent in each functions makes sens.</div><div><br></div>
<div style>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. </div>
<div><br></div><div>Leveraging GUI like KCacheGrind [1] to visualize the profiling files could also be an option.</div>
<div><br></div><div>Thanks</div><div>Jc</div><div><br></div><div>[1] <a href="http://kcachegrind.sourceforge.net/html/Shot3Large.html" target="_blank">http://kcachegrind.sourceforge.net/html/Shot3Large.html</a></div>
</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Apr 23, 2013 at 4:24 PM, Bill Hoffman <span dir="ltr"><<a href="mailto:bill.hoffman@kitware.com" target="_blank">bill.hoffman@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div>On 4/23/2013 3:50 PM, Volo Zyko wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Hi all,<br>
<br>
We have a rather big project and use cmake for building it. At some<br>
point our cmake scripts became very slow (around 4 minutes for single<br>
cmake run). We are thinking now how to speed up it. Searching the web<br>
and this list didn't give any results. It looks like there is no such<br>
thing as profiler for cmake scripts. Am I right?<br>
<br>
What about adding such capability to cmake? It looks like cmake's trace<br>
provides enough info for time profiling, the only thing that it lacks is<br>
a time stamp. Below is a small patch that adds time stamp and nesting<br>
level (to simplify building a stack trace) to each trace line. Would it<br>
be possible to integrate this change to the main line or are there<br>
better options for time profiling of cmake?<br>
</blockquote>
<br></div>
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.<br>
<br>
An example of my output on the ParaView project:<br>
<br>
4.881 export<br>
4.97701 vtk_wrap_python<br>
5.15999 vtk_module_export<br>
5.45701 VTK_WRAP_ClientServer<br>
5.817 QT4_GET_MOC_FLAGS<br>
6.159 vtk_module_impl<br>
6.38601 pv_pre_wrap_vtk_mod_cs<br>
7.08994 if<br>
7.23499 vtk_add_python_wrapping<br>
7.46001 QT4_WRAP_CPP<br>
7.71494 configure_file<br>
8.59399 vtk_module_config<br>
8.904 pv_process_plugins<br>
8.987 vtk_add_cs_wrapping<br>
9.64503 set<br>
11.654 try_compile<br>
12.748 vtk_module_third_party<br>
17.007 vtk_module_library<br>
37.773 _vtk_module_config_recurse<br>
112.788 include<br>
158.092 add_subdirectory<br>
<br>
Also, thinking of adding some stats to number of times a variable is set and how many variables are used.<br>
<br>
-Bill<br>
<br>
<br>
--<br>
<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/<u></u>opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/<u></u>CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/<u></u>listinfo/cmake</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><a href="tel:%2B1%20919%20869%208849" value="+19198698849" target="_blank">+1 919 869 8849</a><br>
</div></div>