No subject


Wed Apr 10 07:51:04 EDT 2013


-          Makefiles on Windows: slow

-          Visual ide generator : fast

-          Makefiles on linux: fast

I found that when there are many targets in a project, cmake has to write m=
any small files on the HD which seems to be very slow on windows.

Regards,
Gregoire


From: cmake-bounces at cmake.org [mailto:cmake-bounces at cmake.org] On Behalf Of=
 Volo Zyko
Sent: mardi 23 avril 2013 21:51
To: cmake at cmake.org
Subject: [CMake] cmake script profiler

Hi all,

We have a rather big project and use cmake for building it. At some point o=
ur 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 did=
n'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 pro=
vides enough info for time profiling, the only thing that it lacks is a tim=
e 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 t=
o integrate this change to the main line or are there better options for ti=
me profiling of cmake?

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 25ccbc7..0e6725c 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -361,6 +361,8 @@ bool cmMakefile::GetBacktrace(cmListFileBacktrace& back=
trace) const
 void cmMakefile::PrintCommandTrace(const cmListFileFunction& lff)
 {
   cmOStringStream msg;
+  msg << "(" << std::fixed << cmSystemTools::GetTime();
+  msg << ") (" << this->CallStack.size() << ") ";
   msg << lff.FilePath << "(" << lff.Line << "):  ";
   msg << lff.Name << "(";
   for(std::vector<cmListFileArgument>::const_iterator i =3D

--_000_49903A40D8DDE44F8C0809FE1E17E0E36B07A5CADB3PRD0611MB554_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3D"Generator" content=3D"Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
	{font-family:Wingdings;
	panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
	{font-family:Wingdings;
	panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
	{mso-style-priority:34;
	margin-top:0cm;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:36.0pt;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman","serif";}
span.EmailStyle17
	{mso-style-type:personal-reply;
	font-family:"Calibri","sans-serif";
	color:#1F497D;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-family:"Calibri","sans-serif";
	mso-fareast-language:EN-US;}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
	{page:WordSection1;}
/* List Definitions */
@list l0
	{mso-list-id:782069579;
	mso-list-type:hybrid;
	mso-list-template-ids:-536576140 544888134 67895299 67895301 67895297 6789=
5299 67895301 67895297 67895299 67895301;}
@list l0:level1
	{mso-level-start-at:0;
	mso-level-number-format:bullet;
	mso-level-text:-;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-18.0pt;
	font-family:"Calibri","sans-serif";
	mso-fareast-font-family:Calibri;
	mso-bidi-font-family:"Times New Roman";}
@list l0:level2
	{mso-level-number-format:bullet;
	mso-level-text:o;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-18.0pt;
	font-family:"Courier New";}
@list l0:level3
	{mso-level-number-format:bullet;
	mso-level-text:\F0A7;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-18.0pt;
	font-family:Wingdings;}
@list l0:level4
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-18.0pt;
	font-family:Symbol;}
@list l0:level5
	{mso-level-number-format:bullet;
	mso-level-text:o;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-18.0pt;
	font-family:"Courier New";}
@list l0:level6
	{mso-level-number-format:bullet;
	mso-level-text:\F0A7;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-18.0pt;
	font-family:Wingdings;}
@list l0:level7
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-18.0pt;
	font-family:Symbol;}
@list l0:level8
	{mso-level-number-format:bullet;
	mso-level-text:o;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-18.0pt;
	font-family:"Courier New";}
@list l0:level9
	{mso-level-number-format:bullet;
	mso-level-text:\F0A7;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-18.0pt;
	font-family:Wingdings;}
ol
	{margin-bottom:0cm;}
ul
	{margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=3D"FR" link=3D"blue" vlink=3D"purple">
<div class=3D"WordSection1">
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:11.0pt;font-=
family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Hello,<o:p=
></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:11.0pt;font-=
family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp=
;</o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:11.0pt;font-=
family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Are you us=
ing cmake with a Makefiles generator on Windows ?<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:11.0pt;font-=
family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp=
;</o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:11.0pt;font-=
family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">From my ex=
periments here are my observations:<o:p></o:p></span></p>
<p class=3D"MsoListParagraph" style=3D"text-indent:-18.0pt;mso-list:l0 leve=
l1 lfo1"><![if !supportLists]><span lang=3D"EN-US" style=3D"font-size:11.0p=
t;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><sp=
an style=3D"mso-list:Ignore">-<span style=3D"font:7.0pt &quot;Times New Rom=
an&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]><span lang=3D"EN-US" style=3D"font-size:11.0=
pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Ma=
kefiles on Windows: slow<o:p></o:p></span></p>
<p class=3D"MsoListParagraph" style=3D"text-indent:-18.0pt;mso-list:l0 leve=
l1 lfo1"><![if !supportLists]><span lang=3D"EN-US" style=3D"font-size:11.0p=
t;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><sp=
an style=3D"mso-list:Ignore">-<span style=3D"font:7.0pt &quot;Times New Rom=
an&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]><span lang=3D"EN-US" style=3D"font-size:11.0=
pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Vi=
sual ide generator : fast<o:p></o:p></span></p>
<p class=3D"MsoListParagraph" style=3D"text-indent:-18.0pt;mso-list:l0 leve=
l1 lfo1"><![if !supportLists]><span lang=3D"EN-US" style=3D"font-size:11.0p=
t;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><sp=
an style=3D"mso-list:Ignore">-<span style=3D"font:7.0pt &quot;Times New Rom=
an&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]><span lang=3D"EN-US" style=3D"font-size:11.0=
pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Ma=
kefiles on linux: fast<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:11.0pt;font-=
family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp=
;</o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:11.0pt;font-=
family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">I found th=
at when there are many targets in a project, cmake has to write many small =
files on the HD which seems to be very slow on windows.<o:p></o:p></span></=
p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:11.0pt;font-=
family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp=
;</o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:11.0pt;font-=
family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Regards,<o=
:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:11.0pt;font-=
family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Gregoire<o=
:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:11.0pt;font-=
family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp=
;</o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:11.0pt;font-=
family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp=
;</o:p></span></p>
<p class=3D"MsoNormal"><b><span lang=3D"EN-US" style=3D"font-size:10.0pt;fo=
nt-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span =
lang=3D"EN-US" style=3D"font-size:10.0pt;font-family:&quot;Tahoma&quot;,&qu=
ot;sans-serif&quot;"> cmake-bounces at cmake.org [mailto:cmake-bounces at cmake.o=
rg]
<b>On Behalf Of </b>Volo Zyko<br>
<b>Sent:</b> mardi 23 avril 2013 21:51<br>
<b>To:</b> cmake at cmake.org<br>
<b>Subject:</b> [CMake] cmake script profiler<o:p></o:p></span></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<div>
<p class=3D"MsoNormal">Hi all,<o:p></o:p></p>
<div>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class=3D"MsoNormal">We have a rather big project and use cmake for build=
ing 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 th=
e web and this list didn't give any
 results. It looks like there is no such thing as profiler for cmake script=
s. Am I right?<o:p></o:p></p>
</div>
<div>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class=3D"MsoNormal">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 c=
make?<o:p></o:p></p>
</div>
<div>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<div>
<p class=3D"MsoNormal">diff --git a/Source/cmMakefile.cxx b/Source/cmMakefi=
le.cxx<o:p></o:p></p>
</div>
<div>
<p class=3D"MsoNormal">index 25ccbc7..0e6725c 100644<o:p></o:p></p>
</div>
<div>
<p class=3D"MsoNormal">--- a/Source/cmMakefile.cxx<o:p></o:p></p>
</div>
<div>
<p class=3D"MsoNormal">&#43;&#43;&#43; b/Source/cmMakefile.cxx<o:p></o:p></=
p>
</div>
<div>
<p class=3D"MsoNormal">@@ -361,6 &#43;361,8 @@ bool cmMakefile::GetBacktrac=
e(cmListFileBacktrace&amp; backtrace) const<o:p></o:p></p>
</div>
<div>
<p class=3D"MsoNormal">&nbsp;void cmMakefile::PrintCommandTrace(const cmLis=
tFileFunction&amp; lff)<o:p></o:p></p>
</div>
<div>
<p class=3D"MsoNormal">&nbsp;{<o:p></o:p></p>
</div>
<div>
<p class=3D"MsoNormal">&nbsp; &nbsp;cmOStringStream msg;<o:p></o:p></p>
</div>
<div>
<p class=3D"MsoNormal">&#43; &nbsp;msg &lt;&lt; &quot;(&quot; &lt;&lt; std:=
:fixed &lt;&lt; cmSystemTools::GetTime();<o:p></o:p></p>
</div>
<div>
<p class=3D"MsoNormal">&#43; &nbsp;msg &lt;&lt; &quot;) (&quot; &lt;&lt; th=
is-&gt;CallStack.size() &lt;&lt; &quot;) &quot;;<o:p></o:p></p>
</div>
<div>
<p class=3D"MsoNormal">&nbsp; &nbsp;msg &lt;&lt; lff.FilePath &lt;&lt; &quo=
t;(&quot; &lt;&lt; lff.Line &lt;&lt; &quot;): &nbsp;&quot;;<o:p></o:p></p>
</div>
<div>
<p class=3D"MsoNormal">&nbsp; &nbsp;msg &lt;&lt; lff.Name &lt;&lt; &quot;(&=
quot;;<o:p></o:p></p>
</div>
<div>
<p class=3D"MsoNormal">&nbsp; &nbsp;for(std::vector&lt;cmListFileArgument&g=
t;::const_iterator i =3D<o:p></o:p></p>
</div>
</div>
</div>
</div>
</body>
</html>

--_000_49903A40D8DDE44F8C0809FE1E17E0E36B07A5CADB3PRD0611MB554_--


More information about the CMake mailing list