<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: A second look at SCons performance</title>
	<atom:link href="http://www.electric-cloud.com/blog/2010/07/21/a-second-look-at-scons-performance/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.electric-cloud.com/blog/2010/07/21/a-second-look-at-scons-performance/</link>
	<description>This is your source for private development cloud best practices and technical tips and tricks for Electric Cloud solutions</description>
	<lastBuildDate>Thu, 03 May 2012 01:47:53 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Rick Croote</title>
		<link>http://www.electric-cloud.com/blog/2010/07/21/a-second-look-at-scons-performance/#comment-8870</link>
		<dc:creator>Rick Croote</dc:creator>
		<pubDate>Thu, 03 May 2012 01:47:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.electric-cloud.com/?p=655#comment-8870</guid>
		<description>Lots of talk about speed and accuracy.  The accuracy we are talking about is all about the speed.  The fastest builds are the builds that do nothing, or nearly so.  Build avoidance is the key, but if you cannot do that accurately you end up with developers that do nothing but full clean SLOW builds.  Sure, you can throw horsepower at that, lots of expensive software and expensive hardware.  But the slowest, cheapest, accurate build avoidance is likely to still win.  Been there, and done that.</description>
		<content:encoded><![CDATA[<p>Lots of talk about speed and accuracy.  The accuracy we are talking about is all about the speed.  The fastest builds are the builds that do nothing, or nearly so.  Build avoidance is the key, but if you cannot do that accurately you end up with developers that do nothing but full clean SLOW builds.  Sure, you can throw horsepower at that, lots of expensive software and expensive hardware.  But the slowest, cheapest, accurate build avoidance is likely to still win.  Been there, and done that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rick Croote</title>
		<link>http://www.electric-cloud.com/blog/2010/07/21/a-second-look-at-scons-performance/#comment-8869</link>
		<dc:creator>Rick Croote</dc:creator>
		<pubDate>Thu, 03 May 2012 01:43:57 +0000</pubDate>
		<guid isPermaLink="false">http://blog.electric-cloud.com/?p=655#comment-8869</guid>
		<description>The --interactive option I have not used too much, but it is pretty neat and save a lot of time.  It&#039;s role would be where a the developer was going to manually build no more than a few targets over and over again.  That does not many hundreds of files are not getting built or checked, but just that only a few are actually typed and executed from the build command.  It has the downside of not reading the configuration files, which is why it is so fast to use, but if your change is in the configuration files, then it is not a good option.</description>
		<content:encoded><![CDATA[<p>The &#8211;interactive option I have not used too much, but it is pretty neat and save a lot of time.  It&#8217;s role would be where a the developer was going to manually build no more than a few targets over and over again.  That does not many hundreds of files are not getting built or checked, but just that only a few are actually typed and executed from the build command.  It has the downside of not reading the configuration files, which is why it is so fast to use, but if your change is in the configuration files, then it is not a good option.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rick Croote</title>
		<link>http://www.electric-cloud.com/blog/2010/07/21/a-second-look-at-scons-performance/#comment-8868</link>
		<dc:creator>Rick Croote</dc:creator>
		<pubDate>Thu, 03 May 2012 01:30:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.electric-cloud.com/?p=655#comment-8868</guid>
		<description>Interesting study, and I would agree that SCons is very heavy, but accurate, and much lower maintenance that other builds systems.  Some may remember me working with your engineers on Accelorator builds.  At the time we were quite happy with Cons very fast incremental builds.  

Well, I got pushed, so now I have just delivered to my team probably the first SCons replacement for MSBuild, meaning that I use MSBuild configuration files to build rather than normal SCons SConscript.py files, although I can do both simulataneously.  The developers get to use both build systems, and use Visual Studio to actually build and manage the build.  What I have over on MSBuild is that I do not have the Solution boundary that MSBuild does, so I can build many Solutions simultaneously and at the individual target level, not at the project level like MSBuild.  Our build right now consists of 53 Solution files and 3 SConscript.py files, and hundreds of VCXproj and CSproj files.  Oh, and we build Debug and Release simultaneously as well.

As for performance, I have not measured as closely as you, so no pretty graphs, but I think I am now seeing how SCons is getting in its own way, but we are going so fast no one is looking, well, except for me.  Our typical build machine is now a 3.33 GHz machine 6 cores with 12G of ram.  Why 12G, well you said it, on a Win7 box with the size of our build, SCons is using up about 6G, which is what we started with, and a few noticed great build times, but the machines were not very responsive during a build.  The 12G made the machine responsive again, and sadly, no improvement in build times.

Hyperthreading on or off doesn&#039;t manner, the processor seems to be in our way as we are doing full builds incredibly fast, typically 12 tasks at a time, with hyperthreading on, across all boundaries that MSBuild is not capable of doing.  We are building approximately 20,000+ targets in about 70 minutes, but here is where I believe you have hit the nail on the head.  I believe the actual build time could be much faster as SCons is starving the cores by not being able to find enough things to build fast enough.  That starvation is from SCons not being able to multithread its own internal work to find things to build faster.  If it could farm out the scanning of dependencies to other processes/threads and in that way it could build the dependencies tree faster and provide targets to be built faster.  Another measure of how well the build is doing, but yet SCons internally is not doing well is that the gap between a do nothing build and a full clean build has closed considerably, where before on single threaded builds the do nothing builds would be a small fraction of the total build time, and now, the incremental do nothing build is greater the 50% of the total build time.

SCons is scanning for dependencies on the fly, therefore removing a ton of developer maintenance and errors, and yes, that costs, but it costs more and is less accurate for the developer to do it.  We are getting that done reliably and I have a lot of happy developers.  Everything right now is how do we multi-process more tasks and save yet more time.  

So, I hate to be argumentitive, but scale it does, very well, I have not detected any limit that at least cheap memory will not solve nicely and they are already shipping 8 core processors.  And as builds get large, they would normally get harder to maintain, but this is all the more reason to use SCons where dependency scanning shines in a big way.

So, given a total choice of build systems would I use SCons again?  Well, so far my boss keeps denying me the freedom to write my own, which I would prefer to write that side now that I have the MSBuild side done.  And even if I did, and wrote it much better with more multiprocessing, laws of deminishing returns, I believe we are running tight enough that we would likely not get the gain we would hope for, and again, we are blazing right now.  Faster processors, now there is where it is at.</description>
		<content:encoded><![CDATA[<p>Interesting study, and I would agree that SCons is very heavy, but accurate, and much lower maintenance that other builds systems.  Some may remember me working with your engineers on Accelorator builds.  At the time we were quite happy with Cons very fast incremental builds.  </p>
<p>Well, I got pushed, so now I have just delivered to my team probably the first SCons replacement for MSBuild, meaning that I use MSBuild configuration files to build rather than normal SCons SConscript.py files, although I can do both simulataneously.  The developers get to use both build systems, and use Visual Studio to actually build and manage the build.  What I have over on MSBuild is that I do not have the Solution boundary that MSBuild does, so I can build many Solutions simultaneously and at the individual target level, not at the project level like MSBuild.  Our build right now consists of 53 Solution files and 3 SConscript.py files, and hundreds of VCXproj and CSproj files.  Oh, and we build Debug and Release simultaneously as well.</p>
<p>As for performance, I have not measured as closely as you, so no pretty graphs, but I think I am now seeing how SCons is getting in its own way, but we are going so fast no one is looking, well, except for me.  Our typical build machine is now a 3.33 GHz machine 6 cores with 12G of ram.  Why 12G, well you said it, on a Win7 box with the size of our build, SCons is using up about 6G, which is what we started with, and a few noticed great build times, but the machines were not very responsive during a build.  The 12G made the machine responsive again, and sadly, no improvement in build times.</p>
<p>Hyperthreading on or off doesn&#8217;t manner, the processor seems to be in our way as we are doing full builds incredibly fast, typically 12 tasks at a time, with hyperthreading on, across all boundaries that MSBuild is not capable of doing.  We are building approximately 20,000+ targets in about 70 minutes, but here is where I believe you have hit the nail on the head.  I believe the actual build time could be much faster as SCons is starving the cores by not being able to find enough things to build fast enough.  That starvation is from SCons not being able to multithread its own internal work to find things to build faster.  If it could farm out the scanning of dependencies to other processes/threads and in that way it could build the dependencies tree faster and provide targets to be built faster.  Another measure of how well the build is doing, but yet SCons internally is not doing well is that the gap between a do nothing build and a full clean build has closed considerably, where before on single threaded builds the do nothing builds would be a small fraction of the total build time, and now, the incremental do nothing build is greater the 50% of the total build time.</p>
<p>SCons is scanning for dependencies on the fly, therefore removing a ton of developer maintenance and errors, and yes, that costs, but it costs more and is less accurate for the developer to do it.  We are getting that done reliably and I have a lot of happy developers.  Everything right now is how do we multi-process more tasks and save yet more time.  </p>
<p>So, I hate to be argumentitive, but scale it does, very well, I have not detected any limit that at least cheap memory will not solve nicely and they are already shipping 8 core processors.  And as builds get large, they would normally get harder to maintain, but this is all the more reason to use SCons where dependency scanning shines in a big way.</p>
<p>So, given a total choice of build systems would I use SCons again?  Well, so far my boss keeps denying me the freedom to write my own, which I would prefer to write that side now that I have the MSBuild side done.  And even if I did, and wrote it much better with more multiprocessing, laws of deminishing returns, I believe we are running tight enough that we would likely not get the gain we would hope for, and again, we are blazing right now.  Faster processors, now there is where it is at.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Armed and Dangerous &#187; Blog Archive &#187; Analysis of scaling problems in build systems</title>
		<link>http://www.electric-cloud.com/blog/2010/07/21/a-second-look-at-scons-performance/#comment-6513</link>
		<dc:creator>Armed and Dangerous &#187; Blog Archive &#187; Analysis of scaling problems in build systems</dc:creator>
		<pubDate>Tue, 27 Dec 2011 09:50:55 +0000</pubDate>
		<guid isPermaLink="false">http://blog.electric-cloud.com/?p=655#comment-6513</guid>
		<description>[...] this, I thought that a complexity of O(n**2) in the number of objects was empirically confirmed by Eric Melski&#8217;s performance plot &#8211; but, as it turns out, this curve could fit O(n log n) as [...]</description>
		<content:encoded><![CDATA[<p>[...] this, I thought that a complexity of O(n**2) in the number of objects was empirically confirmed by Eric Melski&#8217;s performance plot &#8211; but, as it turns out, this curve could fit O(n log n) as [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Melski</title>
		<link>http://www.electric-cloud.com/blog/2010/07/21/a-second-look-at-scons-performance/#comment-2717</link>
		<dc:creator>Eric Melski</dc:creator>
		<pubDate>Thu, 14 Apr 2011 05:19:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.electric-cloud.com/?p=655#comment-2717</guid>
		<description>@Jakub: sorry, I don&#039;t have time to do that.  My data is available &lt;a href=&quot;http://pastebin.com/hZNEbj5A&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; if you&#039;d like to give it a go.  You may also be interested in &lt;a href=&quot;http://blog.electric-cloud.com/2010/03/08/how-scalable-is-scons/&quot; rel=&quot;nofollow&quot;&gt;my first examination of SCons performance&lt;/a&gt; which includes a graph showing SCons performance side-by-side with a x-squared curve.</description>
		<content:encoded><![CDATA[<p>@Jakub: sorry, I don&#8217;t have time to do that.  My data is available <a href="http://pastebin.com/hZNEbj5A" rel="nofollow">here</a> if you&#8217;d like to give it a go.  You may also be interested in <a href="http://blog.electric-cloud.com/2010/03/08/how-scalable-is-scons/" rel="nofollow">my first examination of SCons performance</a> which includes a graph showing SCons performance side-by-side with a x-squared curve.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jakub Narębski</title>
		<link>http://www.electric-cloud.com/blog/2010/07/21/a-second-look-at-scons-performance/#comment-2709</link>
		<dc:creator>Jakub Narębski</dc:creator>
		<pubDate>Wed, 13 Apr 2011 15:25:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.electric-cloud.com/?p=655#comment-2709</guid>
		<description>Could you please redo plots in loglog scale (logarithmic scale on both axes), and do linear fit to find k in O(n ** k) behavior (of least squares fit to O(n ** k) behavior)?</description>
		<content:encoded><![CDATA[<p>Could you please redo plots in loglog scale (logarithmic scale on both axes), and do linear fit to find k in O(n ** k) behavior (of least squares fit to O(n ** k) behavior)?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Melski</title>
		<link>http://www.electric-cloud.com/blog/2010/07/21/a-second-look-at-scons-performance/#comment-2325</link>
		<dc:creator>Eric Melski</dc:creator>
		<pubDate>Thu, 17 Mar 2011 18:07:57 +0000</pubDate>
		<guid isPermaLink="false">http://blog.electric-cloud.com/?p=655#comment-2325</guid>
		<description>@Chris: that&#039;s not how my test was structured, but please do take a look for yourself.  I did originally have a structure like that, and that gave even more horrifically bad performance, as you can imagine -- something closer to N4, naturally.

Regarding the use of &#039;toy&#039; sources -- obviously that&#039;s what I had to do for these tests.  There aren&#039;t many real projects of the magnitude I was testing (tens of thousands of files); at least, there aren&#039;t many that are publicly accessible.  Even if such a project existed, it&#039;s not worth my time to convert the build system of a large real project from one tool to another simply for the sake of benchmarks like this.

Finally, when you&#039;re talking about a substantial code base, 10% is still a significant amount of actual time.  On a two-hour long build, that&#039;s almost 15 minutes.  Not huge, but not chump change either.  Given my druthers, I&#039;ll take the faster build system and get out of the office 15 minutes before you every day :).</description>
		<content:encoded><![CDATA[<p>@Chris: that&#8217;s not how my test was structured, but please do take a look for yourself.  I did originally have a structure like that, and that gave even more horrifically bad performance, as you can imagine &#8212; something closer to N4, naturally.</p>
<p>Regarding the use of &#8216;toy&#8217; sources &#8212; obviously that&#8217;s what I had to do for these tests.  There aren&#8217;t many real projects of the magnitude I was testing (tens of thousands of files); at least, there aren&#8217;t many that are publicly accessible.  Even if such a project existed, it&#8217;s not worth my time to convert the build system of a large real project from one tool to another simply for the sake of benchmarks like this.</p>
<p>Finally, when you&#8217;re talking about a substantial code base, 10% is still a significant amount of actual time.  On a two-hour long build, that&#8217;s almost 15 minutes.  Not huge, but not chump change either.  Given my druthers, I&#8217;ll take the faster build system and get out of the office 15 minutes before you every day <img src='http://www.electric-cloud.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris BeHanna</title>
		<link>http://www.electric-cloud.com/blog/2010/07/21/a-second-look-at-scons-performance/#comment-2324</link>
		<dc:creator>Chris BeHanna</dc:creator>
		<pubDate>Thu, 17 Mar 2011 17:07:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.electric-cloud.com/?p=655#comment-2324</guid>
		<description>Eric, whenever I&#039;ve seen scons performance go pear-shaped, it&#039;s because someone did something like

srcs = [big list o&#039; files]
targets = [big list o&#039; files]

and then naively did

env.SomeBuilder(targets, sources)

SCons makes every target in a builder invocation depend upon every source, so rather than the dependency graph gaining N edges, it gains N^2 edges (assuming, for example, the sources are C files and the targets are their corresponding .o files).

The shortcuts of either inserting a proxy dependency (one of the tricks from the &quot;GoFastButton&quot; page) or using iteration or a list comprehension to invoke the builder once per source file/target file pair both result in DRAMATIC improvements in performance.

I have not yet looked at your benchmark, but I can say, having converted a code base of about 2M lines of code, that scons is actually faster than GNU make in our build, when building (or incrementally rebuilding) the whole tree, and in particular when using a cache for rebuilds (10x speedup there).

Furthermore, one cannot understate the improvement that comes from using an MD5 hash to decide when to rebuild:  the ripple effects of making a change are MUCH better contained, as you no longer necessarily have to rebuild EVERYTHING that&#039;s downstream of your change.

I hope to have time to look at your benchmark in detail; thus far, all of the benchmarks that I&#039;ve seen have used toy sources that are pathological for scons:  sure, the overhead can be huge when the compile time for each source file is on the order of a fraction of a second.  On a real code base, however, the compile times aren&#039;t necessarily small (template-heavy C++ code built with -O2, for example, can take awhile), and the overall speedup you get from limiting downstream ripple effects from a change, coupled with the ability to pull stuff from the cache, ends up being a HUGE win.  IOW, the overhead from SCons on nontrivial code bases, although still observable, fades to something less than ten percent, IME.

Thanks for the article.</description>
		<content:encoded><![CDATA[<p>Eric, whenever I&#8217;ve seen scons performance go pear-shaped, it&#8217;s because someone did something like</p>
<p>srcs = [big list o' files]<br />
targets = [big list o' files]</p>
<p>and then naively did</p>
<p>env.SomeBuilder(targets, sources)</p>
<p>SCons makes every target in a builder invocation depend upon every source, so rather than the dependency graph gaining N edges, it gains N^2 edges (assuming, for example, the sources are C files and the targets are their corresponding .o files).</p>
<p>The shortcuts of either inserting a proxy dependency (one of the tricks from the &#8220;GoFastButton&#8221; page) or using iteration or a list comprehension to invoke the builder once per source file/target file pair both result in DRAMATIC improvements in performance.</p>
<p>I have not yet looked at your benchmark, but I can say, having converted a code base of about 2M lines of code, that scons is actually faster than GNU make in our build, when building (or incrementally rebuilding) the whole tree, and in particular when using a cache for rebuilds (10x speedup there).</p>
<p>Furthermore, one cannot understate the improvement that comes from using an MD5 hash to decide when to rebuild:  the ripple effects of making a change are MUCH better contained, as you no longer necessarily have to rebuild EVERYTHING that&#8217;s downstream of your change.</p>
<p>I hope to have time to look at your benchmark in detail; thus far, all of the benchmarks that I&#8217;ve seen have used toy sources that are pathological for scons:  sure, the overhead can be huge when the compile time for each source file is on the order of a fraction of a second.  On a real code base, however, the compile times aren&#8217;t necessarily small (template-heavy C++ code built with -O2, for example, can take awhile), and the overall speedup you get from limiting downstream ripple effects from a change, coupled with the ability to pull stuff from the cache, ends up being a HUGE win.  IOW, the overhead from SCons on nontrivial code bases, although still observable, fades to something less than ten percent, IME.</p>
<p>Thanks for the article.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Melski</title>
		<link>http://www.electric-cloud.com/blog/2010/07/21/a-second-look-at-scons-performance/#comment-2244</link>
		<dc:creator>Eric Melski</dc:creator>
		<pubDate>Thu, 10 Mar 2011 07:20:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.electric-cloud.com/?p=655#comment-2244</guid>
		<description>I used the default SCons settings, which I assume means it was doing md5 checksums during the up-to-date check.  However, the test files were all trivial -- less than a couple hundred bytes each.  I don&#039;t believe the md5 cost was a significant part of the problem, although I suppose it is possible.</description>
		<content:encoded><![CDATA[<p>I used the default SCons settings, which I assume means it was doing md5 checksums during the up-to-date check.  However, the test files were all trivial &#8212; less than a couple hundred bytes each.  I don&#8217;t believe the md5 cost was a significant part of the problem, although I suppose it is possible.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike MacFaden</title>
		<link>http://www.electric-cloud.com/blog/2010/07/21/a-second-look-at-scons-performance/#comment-2220</link>
		<dc:creator>Mike MacFaden</dc:creator>
		<pubDate>Tue, 08 Mar 2011 06:34:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.electric-cloud.com/?p=655#comment-2220</guid>
		<description>Would be good to know if the comparison to make was done with scons Decider function = timestamp-newer

http://www.scons.org/doc/2.0.0.final.0/HTML/scons-man.html
Yeah it wasn&#039;t clear</description>
		<content:encoded><![CDATA[<p>Would be good to know if the comparison to make was done with scons Decider function = timestamp-newer</p>
<p><a href="http://www.scons.org/doc/2.0.0.final.0/HTML/scons-man.html" rel="nofollow">http://www.scons.org/doc/2.0.0.final.0/HTML/scons-man.html</a><br />
Yeah it wasn&#8217;t clear</p>
]]></content:encoded>
	</item>
</channel>
</rss>

