<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>MSBuild Team Blog : Sumedh Kanetkar</title><link>http://blogs.msdn.com/msbuild/archive/tags/Sumedh+Kanetkar/default.aspx</link><description>Tags: Sumedh Kanetkar</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Parallelizing Visual Studio solutions</title><link>http://blogs.msdn.com/msbuild/archive/2005/11/09/491044.aspx</link><pubDate>Thu, 10 Nov 2005 01:50:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:491044</guid><dc:creator>msbuild</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/msbuild/comments/491044.aspx</comments><wfw:commentRss>http://blogs.msdn.com/msbuild/commentrss.aspx?PostID=491044</wfw:commentRss><description>&lt;P&gt;One of the MSBuild Team’s scenarios for multi-proc builds is the automatic parallelization of Visual Studio solutions. For this scenario, we want Visual Studio to automatically parallelize all “independent” projects, and serialize all “dependent” ones.&lt;/P&gt;
&lt;P&gt;The key here is the separation of projects into the “independent” and “dependent” buckets. The separation is entirely based on project-to-project references and the ordering of projects in the “Project Dependencies” dialog. If the dependencies are not set up correctly, Visual Studio may end up building some dependent projects in parallel and thus break the build.&lt;/P&gt;
&lt;P&gt;Visual C++ (VC) projects in Visual Studio 2005 have already adopted the “parallel by default” model. For any solution that contains VC projects, Visual Studio automatically builds the independent projects in parallel. For consistency with VC projects, we are thinking of adopting the same model for managed projects (C#, VB and J#), and reusing the same Visual Studio mechanisms for parallelism.&lt;/P&gt;
&lt;P&gt;It is not clear to us, however, how many solutions this will negatively affect. If VS 2005 solutions that contain managed projects do not have their project dependencies set up correctly, when these solutions are opened in the next version of VS, their builds will break when they are automatically built in parallel. While this would not be ideal, the fix, of course, would be to update the project dependencies.&lt;/P&gt;
&lt;P&gt;There are two ways to add project dependencies to the solution: project-to-project references (&lt;A href="http://msdn2.microsoft.com/en-us/library/7314433t.aspx"&gt;http://msdn2.microsoft.com/en-us/library/7314433t.aspx&lt;/A&gt;), or project build dependencies (&lt;A href="http://msdn2.microsoft.com/en-us/library/et61xzb3"&gt;http://msdn2.microsoft.com/en-us/library/et61xzb3&lt;/A&gt;). Setting up a project build dependency ensures the dependent project is built after the projects it depends on. Adding a project-to-project reference additionally passes the output assembly of the referenced project as a reference to the compiler while building the referencing project. (Note that VS 2005 allows adding a project-to-project reference to a project with an exe output.)&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://msbuild.members.winisp.net/images/project_dependencies.jpg"&gt;&lt;/P&gt;
&lt;P&gt;We are planning to use more formal means to gather data on real-world solutions, but in the meantime, we would appreciate your thoughts on this issue. You can add a comment to this blog entry, or send email to &lt;A href="mailto:msbuild@microsoft.com"&gt;msbuild@microsoft.com&lt;/A&gt;.&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;[ Author: Sumedh Kanetkar ]&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=491044" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/msbuild/archive/tags/Sumedh+Kanetkar/default.aspx">Sumedh Kanetkar</category><category domain="http://blogs.msdn.com/msbuild/archive/tags/Futures/default.aspx">Futures</category></item><item><title>Parallel builds scenarios and implementation ideas</title><link>http://blogs.msdn.com/msbuild/archive/2005/10/14/481171.aspx</link><pubDate>Fri, 14 Oct 2005 21:19:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:481171</guid><dc:creator>msbuild</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/msbuild/comments/481171.aspx</comments><wfw:commentRss>http://blogs.msdn.com/msbuild/commentrss.aspx?PostID=481171</wfw:commentRss><description>&lt;P&gt;The MSBuild Team has started thinking about adding multi-proc support to the MSBuild engine. Currently MSBuild is single-threaded and does not take advantage of any opportunities for parallel processing during a build. However, most builds inherently have chunks of work that can be done concurrently. By parallelizing these independent chunks of work we aim to reduce the total build time for all builds, large and small.&lt;/P&gt;
&lt;P&gt;To enable parallel builds, we believe we need to support the following scenarios:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Ability to build a large tree of projects in parallel – we call this the “build lab” scenario. In this scenario multiple projects are built concurrently. 
&lt;LI&gt;Ability to build a Visual Studio solution in parallel. Solutions in Visual Studio can contain multiple projects, and even for simple solutions we should be able to support parallel builds. In this scenario, the independent projects are built concurrently, while the dependent ones are serialized. 
&lt;LI&gt;Ability to build multiple files in a project concurrently. Some projects have lots of files that need to be operated on by a single tool one-by-one. In this scenario, the tool is invoked concurrently on all the files.&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;We currently believe that scenarios (1) and (2) would provide the “biggest bang for the buck” in build performance. However, MSBuild is a general build orchestration engine and we know some of our customers build things other than source code. For many of these customers, supporting (3) would offer them significant benefits. This is particularly the case if the build calls into older tools that don’t support multi-processor machines natively. As a result, we believe we also need to look into supporting the parallelization of tasks within a build.&lt;/P&gt;&lt;IMG src="http://msbuild.members.winisp.net/images/multiproc_whiteboard.jpg"&gt; 
&lt;P&gt;In addition to thinking about scenarios, we're working on implementation designs (as you can see from the above picture!). On the implementation side the build mechanism we are considering is completely declarative. The MSBuild engine will not make any attempt to determine what can be parallelized. Instead, we will instead introduce parallelization “constructs” in the file format that will allow a project or targets file author to indicate what can and cannot be parallelized.&lt;/P&gt;
&lt;P&gt;For Visual Studio solutions, the parallelization will be automatic in a sense. The target files we will ship will allow all independent projects in a solution to be parallelized. As long as the dependencies are correctly expressed through project-to-project references, or through the “Project Dependencies” dialog, the build will parallelize correctly.&lt;/P&gt;
&lt;P&gt;Now is your chance to give us feedback! What do your builds look like? How would the above three points of parallelization improve your build performance? What do you think about our plans to introduce new construcuts? Let us know by replying to this post, or send us email at &lt;A href="mailto:msbuild@microsoft.com"&gt;msbuild@microsoft.com&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;[ Author: Sumedh Kanetkar ] &lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=481171" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/msbuild/archive/tags/Sumedh+Kanetkar/default.aspx">Sumedh Kanetkar</category><category domain="http://blogs.msdn.com/msbuild/archive/tags/Futures/default.aspx">Futures</category></item></channel></rss>