<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">Rico Mariani&amp;#39;s Performance Tidbits</title><subtitle type="html">Implying no warranties and conferring no rights: &amp;quot;AS IS&amp;quot; since 1988</subtitle><id>http://blogs.msdn.com/b/ricom/atom.aspx</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/ricom/" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/b/ricom/atom.aspx" /><generator uri="http://telligent.com" version="5.6.50428.7875">Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><updated>2009-10-14T19:32:00Z</updated><entry><title>Some nice performance features in Visual Studio 11</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/ricom/archive/2012/03/21/some-nice-performance-features-in-visual-studio-11.aspx" /><id>http://blogs.msdn.com/b/ricom/archive/2012/03/21/some-nice-performance-features-in-visual-studio-11.aspx</id><published>2012-03-21T22:17:02Z</published><updated>2012-03-21T22:17:02Z</updated><content type="html">&lt;p&gt;This sort of &lt;a href="http://blogs.msdn.com/b/visualstudio/archive/2012/03/12/visual-studio-11-beta-performance-part-2.aspx"&gt;solution managment&lt;/a&gt; brings welcome relief.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10286097" width="1" height="1"&gt;</content><author><name>ricom</name><uri>http://blogs.msdn.com/ricom/ProfileUrlRedirect.ashx</uri></author><category term="visual studio" scheme="http://blogs.msdn.com/b/ricom/archive/tags/visual+studio/" /></entry><entry><title>Amazing Grace Hopper on Nanoseconds</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/ricom/archive/2012/03/02/amazing-grace-hopper-on-nanoseconds.aspx" /><id>http://blogs.msdn.com/b/ricom/archive/2012/03/02/amazing-grace-hopper-on-nanoseconds.aspx</id><published>2012-03-02T19:15:42Z</published><updated>2012-03-02T19:15:42Z</updated><content type="html">&lt;p&gt;Just found this: &lt;a href="http://highscalability.com/blog/2012/3/1/grace-hopper-to-programmers-mind-your-nanoseconds.html"&gt;http://highscalability.com/blog/2012/3/1/grace-hopper-to-programmers-mind-your-nanoseconds.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Worth it just to hear &lt;a href="http://en.wikipedia.org/wiki/Grace_hopper"&gt;Grace&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I think I'll get some microseconds to hang around people's necks.&amp;nbsp; Maybe I'll be kind and use fiber instead of copper :)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10276645" width="1" height="1"&gt;</content><author><name>ricom</name><uri>http://blogs.msdn.com/ricom/ProfileUrlRedirect.ashx</uri></author><category term="recommendations" scheme="http://blogs.msdn.com/b/ricom/archive/tags/recommendations/" /></entry><entry><title>Software Performance for Metro Style Applications</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/ricom/archive/2012/03/01/software-performance-for-metro-style-applications.aspx" /><id>http://blogs.msdn.com/b/ricom/archive/2012/03/01/software-performance-for-metro-style-applications.aspx</id><published>2012-03-01T18:56:00Z</published><updated>2012-03-01T18:56:00Z</updated><content type="html">&lt;p&gt;With the Windows Consumer Preview out the door, I thought it would be interesting to write something about creating great performing Windows applications.&amp;nbsp; I hope to have a lot more to say about this in the future but I think really the most important things I have to say are more inspirational rather than informational at this point. The key point is that things are quite a bit different than they were, and how you think about creating an application with great performance is perhaps different than it ever has been.&lt;/p&gt;
&lt;p&gt;OK that&amp;rsquo;s a mouthful, what am I talking about?&lt;/p&gt;
&lt;p&gt;Well one thing is the operating system itself is a lot more frugal. Improvements in Win7 and continuing improvements in Win8 mean you get more of your system resources available for your applications. Great news!&amp;nbsp; And what are those applications going to do with those resources?&amp;nbsp; Why use them of course!&amp;nbsp; Hopefully wisely, to create great experiences when they are active and economically fade to nothing when they are not.&amp;nbsp; As we&amp;rsquo;ll see, resource usage is more temporal in Win8 and so management is essential.&lt;/p&gt;
&lt;p&gt;Back when I worked on the Whidbey CLR we thought a modest forms-based application ought to be able to start up in something like 50ms and use something roughly like 5MB of working set.&lt;/p&gt;
&lt;p&gt;In many ways we considered the working set number to be too big. We addressed that at least in part by making as much of that memory shared as possible &amp;ndash; good for amortizing the cost over many processes.&amp;nbsp; Big fractions of the private memory came from things like the GC heap&amp;rsquo;s initial allocation, and pre-committed stack pages plus other fixed costs but much of it had to do the raw cost of getting a CLR application going.&amp;nbsp; Still that&amp;rsquo;s where we were:&amp;nbsp; 50ms and maybe 5MB, fighting to go down from there.&lt;/p&gt;
&lt;p&gt;Fast forward to 2012 and things look a lot different.&amp;nbsp; A metro style application might spend say 9 frames @60 Hz fading in a splash screen (call it 150ms) and then another 9 fading it out.&amp;nbsp; And then maybe as many doing some cool slide-in type effect as the title comes in from one side and the data from the other.&amp;nbsp; These kinds of effects are part of the Metro look and feel.&amp;nbsp; Now at that point we haven&amp;rsquo;t actually done anything per se and we&amp;rsquo;ve spent maybe 450ms just on animations.&lt;/p&gt;
&lt;p&gt;Memory wise, to do those transitions we probably have spent private memory to the tune of 3 full screen surfaces.&amp;nbsp; Easily 4MB each (at 1366x768) with probably 2 live at any given moment and that&amp;rsquo;s just the memory for the video.&amp;nbsp; Clearly the world is a different place.&amp;nbsp; And already the temporal nature of resource usage is showing clearly, those costs are short term.&lt;/p&gt;
&lt;p&gt;So what does it mean?&lt;/p&gt;
&lt;p&gt;This metro style application experience, despite the fact that it takes longer to start up, is actually much more pleasing to use.&amp;nbsp; It responded instantly to our command and fit nicely into the expected design.&amp;nbsp; I think that&amp;rsquo;s the most important observation: in a metro style application we do get some more latitude to use video memory especially for effects but the price we pay is that we have even less latitude for stalls.&amp;nbsp; People expect a smooth responsive system at all stages.&amp;nbsp; No video glitches, no jerkiness, no synchronous pauses to get resources, no long wait-cursors.&amp;nbsp; The expectation has been set from the first frame that your experience will be a lovely one and applications that don&amp;rsquo;t deliver will look like old klunkers.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s also consider where this extra memory came from: video memory is in many ways the cheapest in terms of time-to-get-ready.&amp;nbsp; In previous frameworks we were dealing with mostly code that had to be brought in and working set was a good proxy to startup time because working set tends to translate directly to disk IO.&amp;nbsp; Clean video surfaces don&amp;rsquo;t have to be paged in so that (nearly) 1:1 relationship between working set and startup time is ancient history.&amp;nbsp; Which isn&amp;rsquo;t to say you can now load all the code you like: you can&amp;rsquo;t, especially not all at once because page faults turn into glitches.&amp;nbsp; Like all your other resources you&amp;rsquo;ll want to get them loaded asynchronously and have a good UI experience while they are coming in.&amp;nbsp; That means don&amp;rsquo;t load your whole program at startup, don&amp;rsquo;t initialize everything you might ever need, and create suitable transitions and incremental experiences for data and program parts arriving.&amp;nbsp; In a great application all of that is part of the overall experience.&lt;/p&gt;
&lt;p&gt;This is why I think it&amp;rsquo;s even harder on the programmer to get all these things right and why it&amp;rsquo;s even more important than ever for the frameworks to give you a Pit of Success experience when you use the normal templates and the normal services to get your job done.&amp;nbsp;&amp;nbsp; If you aren&amp;rsquo;t careful then you&amp;rsquo;ll destroy the intended experience and even &amp;ldquo;a little bit broken&amp;rdquo; will look terrible in contrast to the expectation set by the design.&lt;/p&gt;
&lt;p&gt;Compounding all of this is our desire to run metro style applications on lower end hardware.&amp;nbsp; Some of these systems are equipped with decent GPUs (though not the greatest)&amp;nbsp; but their CPUs offer a raw compute speed that might be say 1/6th (on a per core basis) of a high end desktop.&amp;nbsp; If you want your application to run well in that environment you&amp;rsquo;ll need to think carefully about how much work you do in one transition and how you use asynchronous patterns to keep you application feeling crisp even with CPU resources that are less abundant.&amp;nbsp;&amp;nbsp; Careful testing and measuring on these lower end systems will be essential because your normal development machine could delude you with speed you don&amp;rsquo;t have.&lt;/p&gt;
&lt;p&gt;And as if that&amp;rsquo;s not enough, almost universally power consumption is a huge concern.&amp;nbsp; In unplugged scenarios, whether it&amp;rsquo;s laptop or tablet every joule consumed matters.&amp;nbsp; In some cases a core feature of the tablet is the excellent battery life and hence the lower power CPU and so forth.&amp;nbsp; As an application or framework author you must consider these things very carefully.&amp;nbsp; The system will want to suspend your application when it isn&amp;rsquo;t running &amp;ndash; how will this affect the way you store your state?&amp;nbsp; You will want to have lovely animations while your application is active because that&amp;rsquo;s what a great application does but you&amp;rsquo;ll want to be able to turn those off when you aren&amp;rsquo;t visible.&amp;nbsp; Background activity generally should be looked at with great suspicion because it will drain power.&amp;nbsp; What background work must happen?&amp;nbsp; What could be reduced or suspended entirely?&amp;nbsp;&amp;nbsp;&amp;nbsp; Great choices will mean superior battery life which could be a huge aspect of your success.&lt;/p&gt;
&lt;p&gt;Despite these challenges I&amp;rsquo;m optimistic.&amp;nbsp; I think the Metro design is a great one because has a lovely look while at the same time it is not so terribly hard to create that you must spend all resources to make it.&amp;nbsp; The Metro look and feel is largely composed of things that GPUs do comparatively well.&amp;nbsp; That&amp;rsquo;s good news for everyone and it&amp;rsquo;s a good basis to create your applications.&amp;nbsp; Asynchronous design patterns are possible in all the languages WinRT supports and especially in Javascript, which is likely to be the most popular choice by volume. Asynchronous patterns are already normal for most javascript libraries.&lt;/p&gt;
&lt;p&gt;Bottom line: what constitutes a great performing windows application has changed in the metro world,&amp;nbsp; but great performance is still important, perhaps more important than ever.&lt;/p&gt;
&lt;p&gt;As I said above, I hope to write more about these concerns in the coming weeks but for now I'd like to refer you to some articles that have already been written on MSDN.&amp;nbsp; It's not everything by a longshot but its something.&amp;nbsp; While this particular work discusses the problems in the context of javascript, most of the advice is actually broadly applicable no matter what framework you use.&amp;nbsp;&amp;nbsp; Check it out the guidance &lt;a href="http://msdn.microsoft.com/en-us/library/windows/apps/hh465194.aspx"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10275835" width="1" height="1"&gt;</content><author><name>ricom</name><uri>http://blogs.msdn.com/ricom/ProfileUrlRedirect.ashx</uri></author><category term="performance" scheme="http://blogs.msdn.com/b/ricom/archive/tags/performance/" /></entry><entry><title>Coding in Marble (Part 2)</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/ricom/archive/2012/02/20/coding-in-marble-part-2.aspx" /><id>http://blogs.msdn.com/b/ricom/archive/2012/02/20/coding-in-marble-part-2.aspx</id><published>2012-02-20T22:13:00Z</published><updated>2012-02-20T22:13:00Z</updated><content type="html">&lt;p&gt;I thought I'd follow up on &lt;a href="http://blogs.msdn.com/b/ricom/archive/2012/02/02/coding-in-marble.aspx"&gt;my last technical post&lt;/a&gt; with a few extra details about the Marble pattern, despite the name of the article I mostly talked about the Wood pattern.&amp;nbsp; I guess perhaps this is timely because the use of Promises to represent asynchronous operations is increasingly popular,&amp;nbsp; but these notions are not really limited to context pattern, though promises do make for good examples.&lt;/p&gt;
&lt;p&gt;So, what are the essential properties?&lt;/p&gt;
&lt;p&gt;Wood:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;objects tend to be smaller and more abundant (model the nodes not the tree)&lt;/li&gt;
&lt;li&gt;dependencies and dataflow tends to be represented on a per object basis&lt;/li&gt;
&lt;li&gt;dependencies frequently make long chains (such as a series of promises lashed to one I/O)&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;each object is participating in its own dependency chain but it they are really all the same&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;p&gt;Marble:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;objects tend to be bigger (model the tree not the nodes)&lt;/li&gt;
&lt;li&gt;dependencies and dataflow tend to flow through these big objects, the dependencies are not dependent on the size of the problem but on the necessary transforms&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;the dataflow that SQL uses for running a query is an example of this, complexity of plan is determined by joins/merges not by data size&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;dependencies still can make long chains but&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;the nature of the depenencies is expressed exactly once no matter how much data there is&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;p&gt;Again, using promises as an example (and I am not down on promises at all, they work great, but you don't have switch to the wood pattern universally&amp;nbsp;just because you have async i/o)&lt;/p&gt;
&lt;p&gt;Wood:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;create many async requests for data&lt;/li&gt;
&lt;li&gt;attach additional promises to these requests for processing&lt;/li&gt;
&lt;li&gt;end each promise chain with some operation to do whatever needs doing at the end (such as inserting stuff into a DOM)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Marble:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;create many async results for data&lt;/li&gt;
&lt;li&gt;give the promises to a broker which will handle all of them (and maybe created them in the first place as needed)&lt;/li&gt;
&lt;li&gt;provide any number of handlers to the broker which will run those handlers on each datum as the promises resolve&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In the marble pattern I can still write nice anonymous delegates if I choose, or I can provide a class or other handler, whatever is necessary.&amp;nbsp; However I don't create one handler instance for every datum.&amp;nbsp; I created one or more broker objects that handle the various stages of processing and coordinate some or all of the post steps.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;From a memory perspective Marble is much more economical and of course it doesn't have the terrible property that I'm making lots of long lived objects.&amp;nbsp; In the wood pattern everything ends up being long lived because everything lives at least as long as the I/O request is outstanding.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10270079" width="1" height="1"&gt;</content><author><name>ricom</name><uri>http://blogs.msdn.com/ricom/ProfileUrlRedirect.ashx</uri></author><category term="performance" scheme="http://blogs.msdn.com/b/ricom/archive/tags/performance/" /></entry><entry><title>Measuring IE Performance</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/ricom/archive/2012/02/17/measuring-ie-performance.aspx" /><id>http://blogs.msdn.com/b/ricom/archive/2012/02/17/measuring-ie-performance.aspx</id><published>2012-02-17T16:25:00Z</published><updated>2012-02-17T16:25:00Z</updated><content type="html">&lt;p&gt;The &lt;a href="http://blogs.msdn.com/b/b8"&gt;Building Windows 8&lt;/a&gt; blog has an interesting article on &lt;a href="http://blogs.msdn.com/b/b8/archive/2012/02/16/internet-explorer-performance-lab-reliably-measuring-browser-performance.aspx"&gt;how we measure IE perf&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Recommended reading :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10269086" width="1" height="1"&gt;</content><author><name>ricom</name><uri>http://blogs.msdn.com/ricom/ProfileUrlRedirect.ashx</uri></author><category term="recommendations" scheme="http://blogs.msdn.com/b/ricom/archive/tags/recommendations/" /></entry><entry><title>Coding in Marble</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/ricom/archive/2012/02/02/coding-in-marble.aspx" /><id>http://blogs.msdn.com/b/ricom/archive/2012/02/02/coding-in-marble.aspx</id><published>2012-02-03T03:26:00Z</published><updated>2012-02-03T03:26:00Z</updated><content type="html">&lt;p&gt;I wish I could remember where I first read it because perhaps it deserves attribution.&amp;nbsp; But many years ago I read about the two world views of physicists and they resonated with me.&amp;nbsp; One world view is that prescibed by things like &lt;a href="http://en.wikipedia.org/wiki/General_relativity"&gt;General Relativity&lt;/a&gt;&amp;nbsp;and &lt;a href="http://en.wikipedia.org/wiki/Maxwell%27s_equations"&gt;Maxwell's Equations&lt;/a&gt;.&amp;nbsp; These have, in some sense a great mathematical beauty to them.&amp;nbsp; This is the "the universe is made out of marble" viewpoint.&amp;nbsp; Nice clean fields.&amp;nbsp; Very solid.&amp;nbsp; Then there's the other perspective, this is the perspective you have in systems like &lt;a href="http://en.wikipedia.org/wiki/Quantum_electrodynamics"&gt;Quantum Electrodynamics&lt;/a&gt;.&amp;nbsp; There are lots of particles flying all over the place and probabilities.&amp;nbsp; Lots of statistics.&amp;nbsp; The universe is a messy organic place.&amp;nbsp; It might have been tempting to take those people and lock them away or something but darn it if they didn't keep getting great results.&amp;nbsp; So Marble and Wood.&amp;nbsp; The highly regular vs. messier put powerful.&amp;nbsp; I soon started using this analogy in computer science and that's what I'm writing about today.&lt;/p&gt;
&lt;p&gt;One place this comes up is when programming with &lt;a href="http://en.wikipedia.org/wiki/Promise_(programming)"&gt;promises&lt;/a&gt;, or really any notification system even ad hoc ones.&amp;nbsp; In the case of a promise the situation is that you have some work that needs to be done "later" after some asynchronous operation has completed:&amp;nbsp;&amp;nbsp;let's say that you are waiting for some data and when it arrives you're going to validate and extract some values from it, it doesn't much matter.&amp;nbsp; The natural way to do this with a promise would look something like this:&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;p.then( () =&amp;gt; {do your work} )&lt;/p&gt;
&lt;p&gt;or in javascript you might write&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;p.then( function() { do your work } )&lt;/p&gt;
&lt;p&gt;In fact you can keep combining these things, if you have more work that has to be done after the first batch asynchronously completes you might end up writing something like this:&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;p.then( () =&amp;gt; {do your work} ).then( () =&amp;gt; {do more work}).then( () =&amp;gt; {even more work});&lt;/p&gt;
&lt;p&gt;Now the next thing that's going to happen is you're going to put this in a loop for your various 'p' read operations that need to happen and presto magico your application is done.&amp;nbsp; And you've fallen into the wood trap.&lt;/p&gt;
&lt;p&gt;The reason that I try to avoid this pattern is that what's happened now is that on every iteration you're creating&amp;nbsp;delegate objects and new promise objects that connect the various stages for each operation.&amp;nbsp; But the thing is they're all the same!&amp;nbsp; Despite the fact that all the objects are being handled identically (typical) we get no savings, we are using the most general dispatch mechanism to dispatch the very same code thereby creating far more garbage than is needed.&amp;nbsp; Of course each one of these promise chains encourages the next guy to keep doing the same thing.&amp;nbsp; You could even add stages that merge, select, batch, whatever you need, more stages, more wood.&lt;/p&gt;
&lt;p&gt;The hallmark of the wood pattern is that the same chain of dependencies/computations is re-represented in data repeatedly --&amp;nbsp;achieving no savings for its sameness.&amp;nbsp; It &lt;strong&gt;&lt;em&gt;is&lt;/em&gt;&lt;/strong&gt; the most flexible choice, each datum could be handled seperately in a unique fashion but they probably are not.&lt;/p&gt;
&lt;p&gt;How can you make it better?&lt;/p&gt;
&lt;p&gt;Well of course a different pattern alltogther might be the right choice, something that looks more like this:&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;datasource.handler += () =&amp;gt; { do your work }&lt;/p&gt;
&lt;p&gt;or maybe&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;w1 = new {worker stage one object }&lt;br /&gt;w2 = new {stage 2 handler};&lt;br /&gt;&lt;br /&gt;datasource.handler += w1;&lt;br /&gt;w1.stage2 += w2;&lt;/p&gt;
&lt;p&gt;Now this isn't as flexible but it is much more economical.&amp;nbsp; With one fell swoop we're saying that they are all going to be handled symmetrically and we do not have allocation cost per datum.&lt;/p&gt;
&lt;p&gt;Even if that kind of refactoring isn't possible just this simple thing might be very helpful.&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;var d1 = () =&amp;gt; {do your work};&lt;br /&gt;var d2 = () =&amp;gt; {do more work};&lt;br /&gt;var d3 = () =&amp;gt; {even more work};&lt;br /&gt;&lt;br /&gt;p.then(d1).then(d2).then(d3);&amp;nbsp; // this in your loop&lt;/p&gt;
&lt;p&gt;This second form avoids creating a whole new delegate/closure in each loop iteration so in some sense it's at least partly marblized.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Now of course this kind of transform isn't universally possible but if you start by saying "what are the rules for all my data" and then encoding that then you tend to end up in a place where you have low-to-zero overhead costs for each item and you just do the work.&amp;nbsp; If you don't you can easily end up in a place where there most flexible pattern is being used in a very regular way, at great cost.&lt;/p&gt;
&lt;p&gt;I've often admonished people to use the &lt;a href="http://blogs.msdn.com/b/ricom/archive/2004/08/24/219751.aspx"&gt;simplest&amp;nbsp;programming technique &lt;/a&gt;that will do the job to get the best performance.&amp;nbsp; Specifically, don't use virtual methods if non-virtual will do.&amp;nbsp; Don't use interfaces if virtuals will do.&amp;nbsp; Don't use delegates if interfaces will do.&amp;nbsp; This discussion has in some ways been a rehash of that point.&amp;nbsp; But then I always found that grounding a concept in an example is helpful so hopefully you all found it worth the read.&lt;/p&gt;
&lt;p&gt;P.S. I'm putting the "wood" programming technique in a bad light here but it has its place.&amp;nbsp; And that doesn't mean I'm down on "wood" physics.&amp;nbsp; I happen to think QED is every bit as&amp;nbsp;cool as cool as relativity :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10263508" width="1" height="1"&gt;</content><author><name>ricom</name><uri>http://blogs.msdn.com/ricom/ProfileUrlRedirect.ashx</uri></author><category term="performance" scheme="http://blogs.msdn.com/b/ricom/archive/tags/performance/" /><category term="design advice" scheme="http://blogs.msdn.com/b/ricom/archive/tags/design+advice/" /></entry><entry><title>Ngen or not?  The rules haven't changed very much since 2004</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/ricom/archive/2012/01/31/ngen-or-not-the-rules-haven-t-changed-very-much-since-2004.aspx" /><id>http://blogs.msdn.com/b/ricom/archive/2012/01/31/ngen-or-not-the-rules-haven-t-changed-very-much-since-2004.aspx</id><published>2012-01-31T20:53:00Z</published><updated>2012-01-31T20:53:00Z</updated><content type="html">&lt;p&gt;I still get questions that amount to "should I ngen my &amp;lt;something&amp;gt;" from time to time and the best answer I can give is still "it depends."&amp;nbsp; I wrote this article many years ago, and I'd say it's still pretty accurate: &lt;a href="http://blogs.msdn.com/b/ricom/archive/2004/10/18/244242.aspx"&gt;http://blogs.msdn.com/b/ricom/archive/2004/10/18/244242.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Essentially the situation is this: if you ngen your IL then of course the jit will not have to run but you will have to do more I/O because the compiled code is bigger than the IL.&amp;nbsp; If that I/O is likely to be cached because either:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The code is going to be loaded "a goodly amount of time"&amp;nbsp;after ice cold startup and it's commonly used so &lt;a href="http://en.wikipedia.org/wiki/Windows_Vista_I/O_technologies#SuperFetch"&gt;superfetch&lt;/a&gt; is likely to fetch it, or&lt;/li&gt;
&lt;li&gt;The code is in a library shared by many programs and so only one of those programs at most will have to actually read it at full cost&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;then it's likely that ngen will help you overall.&lt;/p&gt;
&lt;p&gt;If that's not the case then ngen isn't likely to help you.&amp;nbsp; But really you need to measure for yourself.&lt;/p&gt;
&lt;p&gt;Remember also that the code generation for ngen'd binaries is going to tend to optimize for maximum sharability which may come at a (typically small) cost in raw speed so that's a factor as well.&lt;/p&gt;
&lt;p&gt;The most common framework DLLs, like mscorlib, system.dll and friends, tend to be get the most benefits from ngen.&amp;nbsp; Single-use application libraries and executables tend to get the least benefit.&lt;/p&gt;
&lt;p&gt;It's really hard to say more than that with any kind of precision.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10262452" width="1" height="1"&gt;</content><author><name>ricom</name><uri>http://blogs.msdn.com/ricom/ProfileUrlRedirect.ashx</uri></author><category term="performance" scheme="http://blogs.msdn.com/b/ricom/archive/tags/performance/" /></entry><entry><title>Improving .NET Application Performance and Scalability</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/ricom/archive/2012/01/11/improving-net-application-performance-and-scalability.aspx" /><id>http://blogs.msdn.com/b/ricom/archive/2012/01/11/improving-net-application-performance-and-scalability.aspx</id><published>2012-01-11T22:41:21Z</published><updated>2012-01-11T22:41:21Z</updated><content type="html">&lt;p&gt;This series can still be found here:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ff649152.aspx"&gt;http://msdn.microsoft.com/en-us/library/ff649152.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;While some of the content is stale since it refers specifically to .NET 2.0 I think all of the conceptual content broadly applicable (even beyond managed code systems to software systems generally.)&lt;/p&gt;
&lt;p&gt;If you're looking for it some time in the future&amp;nbsp;you can find it again easily with bing.&amp;nbsp; I doubt that they'll get rid of it entirely for a very long time.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10255728" width="1" height="1"&gt;</content><author><name>ricom</name><uri>http://blogs.msdn.com/ricom/ProfileUrlRedirect.ashx</uri></author><category term="performance" scheme="http://blogs.msdn.com/b/ricom/archive/tags/performance/" /></entry><entry><title>Performance and Design Guidelines for Data Access Layers</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/ricom/archive/2012/01/10/performance-and-design-guidelines-for-data-access-layers.aspx" /><id>http://blogs.msdn.com/b/ricom/archive/2012/01/10/performance-and-design-guidelines-for-data-access-layers.aspx</id><published>2012-01-10T21:47:00Z</published><updated>2012-01-10T21:47:00Z</updated><content type="html">&lt;p&gt;Many problems you will face are actually the building data access layer, sometimes thinly disguised, sometimes in your face; it&amp;rsquo;s one of the broad patterns that you see in computer science &amp;ndash; as the clich&amp;eacute; says: it keeps rearing its ugly head.&lt;/p&gt;
&lt;p&gt;Despite this, the same sorts of mistakes tend to be made in the design of such systems so I&amp;rsquo;d like to offer a bit of hard-won advice on how to approach a data access problem. Mostly this is going to be in the form of patterns/anti-patterns but nonetheless I hope it will be useful.&lt;/p&gt;
&lt;p&gt;As always, in the interest of not writing a book, this advice is only approximately correct.&lt;/p&gt;
&lt;p&gt;The main thing that you should remember is that access to the data will take two general shapes.&amp;nbsp; In database parlance you might say some of the work will be &lt;a href="http://en.wikipedia.org/wiki/OLTP"&gt;OLTP&lt;/a&gt;-ish (online transaction processing) and some of the work will be &lt;a href="http://en.wikipedia.org/wiki/OLAP"&gt;OLAP&lt;/a&gt;-ish (online analytical processing).&amp;nbsp;&amp;nbsp; But simply, there&amp;rsquo;s how you update pieces of your data&amp;nbsp;and how your read chunks of it.&amp;nbsp; And they have different needs.&lt;/p&gt;
&lt;p&gt;At present it seems to me that people feel a strong temptation to put an OO interface around the data and expose that to customers.&amp;nbsp; This can be ok as part of the solution if you avoid some pitfalls, so I suggest you follow this advice:&lt;/p&gt;
&lt;p&gt;1. Consider the &lt;a href="http://en.wikipedia.org/wiki/Database_transaction"&gt;unit of work&lt;/a&gt; carefully&lt;/p&gt;
&lt;p&gt;There are likely to be several typical types of updates.&amp;nbsp; Make sure that you fetch enough data so that the typical cases do one batch of reads for necessary data, modify the data locally, and then write back that data in a batch.&amp;nbsp; If you read too much data you incur needless transfer costs, if you read too little data then you make too many round trips to do the whole job.&lt;/p&gt;
&lt;p&gt;You may have noticed that I began with a model where you fetch some data, change it locally, and write it back.&amp;nbsp; This is a fairly obvious thing to do given that you are going to want to do the write-back in probably a single transaction but it&amp;rsquo;s important to do this even if you aren&amp;rsquo;t working in a transacted system.&amp;nbsp; Consider an alternative:&amp;nbsp; if you were to provide some kind of proxy to the data to each client and then RPC each property change back to the server you are in a world of hurt.&amp;nbsp; Now the number of round trips is very high and furthermore it&amp;rsquo;s impossible to write correct code because two people could be changing the very same object at the same time in partial/uncoordinated ways.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This may seem like a silly thing to do but if the authoritative store isn&amp;rsquo;t a database it&amp;rsquo;s all too common for people to forget that the database rules exist for a reason and they probably apply to any kind of store at all.&amp;nbsp; Even if you&amp;rsquo;re using (e.g.) the registry or some other repository you still want to think about unit-of-work and make it so the each normal kind of update is a single operation.&lt;/p&gt;
&lt;p&gt;Whatever you do don&amp;rsquo;t create an API where each field read/write is remoted to get the value.&amp;nbsp; Besides the performance disaster this creates it&amp;rsquo;s impossible to understand what will happen if you several people are doing something like Provider.SomeValue += 1;&lt;/p&gt;
&lt;p&gt;2. Consider your &lt;a href="http://blogs.msdn.com/b/ricom/archive/2004/06/24/165063.aspx"&gt;locking strategy&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Implicit in the discussion above is some notion of accepting or rejecting writes because the data has changed out from under you.&amp;nbsp; This is a normal situation and making it clear that it can and does happen and should be handled makes everyone&amp;rsquo;s life simpler.&amp;nbsp; This is another reason why an API like Provider.SomeValue = 1 to do the writes is a disaster.&amp;nbsp; How does it report failure?&amp;nbsp; And if it failed, how much failed?&lt;/p&gt;
&lt;p&gt;You can choose an &lt;a href="http://en.wikipedia.org/wiki/Optimistic_locking"&gt;optimistic locking&lt;/a&gt; strategy or something else but you&amp;rsquo;ll need one.&amp;nbsp; A sure sign that you have it right is that the failure mode is obvious, and the recovery is equally obvious.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I once had a conversation with &lt;a href="http://en.wikipedia.org/wiki/Jim_Gray_(computer_scientist)"&gt;Jim Gray&lt;/a&gt; where I told him how ironic it was to me that the only reason transactions could ever succeed at all in a hot system was that they had the option of failing.&amp;nbsp; Delicious irony that.&lt;/p&gt;
&lt;p&gt;Remember, even data from a proxy isn&amp;rsquo;t really live.&amp;nbsp; It&amp;rsquo;s an illusion.&amp;nbsp; The moment you say &amp;ldquo;var x = provider.X;&amp;rdquo;&amp;nbsp; your &amp;lsquo;x&amp;rsquo; is already potentially stale by the time it&amp;rsquo;s assigned.&amp;nbsp; Potentially stale data is the norm, it&amp;rsquo;s just a question of how stale and how do you recover. That means some kind of &lt;a href="http://blogs.msdn.com/b/ricom/archive/2006/04/24/582643.aspx"&gt;isolation&lt;/a&gt;&amp;nbsp;and locking choice is mandatory.&lt;/p&gt;
&lt;p&gt;3. Don&amp;rsquo;t forget the queries&lt;/p&gt;
&lt;p&gt;Even if you did everything else completely correctly you&amp;rsquo;ve still only built half the system if all you can do is read and modify entities.&amp;nbsp; The OLAP part of your system will want to do bulk reads like &amp;ldquo;find me all the photos for this week&amp;rdquo;.&amp;nbsp; When doing these types of accesses it is vital to take advantage of their read aspect.&amp;nbsp; Do not create transactable objects just bring back the necessary data in a raw form.&amp;nbsp; Simple arrays of primitives are the best choice; they have the smallest overheads.&amp;nbsp; Do not require multiple round-trips to get commonly required data or the fixed cost of the round trip will end up dwarfing the actual work you're trying to do.&lt;/p&gt;
&lt;p&gt;These queries are supposed to represent a snapshot in time according to whatever isolation model your data has (which comes back to the requirements created by your use cases and your unit of work).&amp;nbsp; If you force people to use your object interface to read raw data you will suffer horrible performance and you will likely have logically inconsistent views of your data.&amp;nbsp; Don&amp;rsquo;t do that.&lt;/p&gt;
&lt;p&gt;One of the reasons that systems like &lt;a href="http://blogs.msdn.com/b/ricom/archive/2007/06/22/dlinq-linq-to-sql-performance-part-1.aspx"&gt;Linq to SQL&lt;/a&gt; were as successful as they were (from various perspectives I think) is that they obeyed these general guidelines:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;you can get a small amount of data or a large amount of data&lt;/li&gt;
&lt;li&gt;you can get objects or just data&lt;/li&gt;
&lt;li&gt;you can write back data chunks in units of your choice&lt;/li&gt;
&lt;li&gt;the failure mode for read/writes is clear, easy to deal with, and in-your-face (yes, reads can fail, too)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Other data layers, while less general no doubt, would do well to follow the same set of rules.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10255291" width="1" height="1"&gt;</content><author><name>ricom</name><uri>http://blogs.msdn.com/ricom/ProfileUrlRedirect.ashx</uri></author><category term="performance" scheme="http://blogs.msdn.com/b/ricom/archive/tags/performance/" /><category term="design advice" scheme="http://blogs.msdn.com/b/ricom/archive/tags/design+advice/" /></entry><entry><title>Performance Guidelines for Properties</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/ricom/archive/2011/12/19/performance-guidelines-for-properties.aspx" /><id>http://blogs.msdn.com/b/ricom/archive/2011/12/19/performance-guidelines-for-properties.aspx</id><published>2011-12-19T20:27:00Z</published><updated>2011-12-19T20:27:00Z</updated><content type="html">&lt;p&gt;I can&amp;rsquo;t say I&amp;rsquo;ve asked the framework guidelines folks about this but I&amp;rsquo;m fairly sure there would be a lot of agreement from the guidelines gurus; so in the spirit of approximately correct advice I give you Rico&amp;rsquo;s Guidelines for Performant Properties.&lt;/p&gt;
&lt;p&gt;I should start by saying I wish more people just used fields instead of committing these terrible sins with their properties.&amp;nbsp; If we had the notion of a type-safe, read-only field the world would be a better place.&amp;nbsp; Alas&amp;hellip;&lt;/p&gt;
&lt;p&gt;So, you&amp;rsquo;re using a property, the most important thing to remember is that it will seem very much like a field in all ways.&amp;nbsp; It looks like a field and feels like a field, people will expect it to perform like a field.&amp;nbsp; So with that in mind:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Accessing the property should not allocate any memory; people are going to use this thing in loops walking over whatever data structure you are presenting, they expect that this data is sitting around and being accessed.&lt;/li&gt;
&lt;li&gt;Accessing the property should not &amp;ldquo;synchronize&amp;rdquo; &amp;ndash; if there is any locking to be done it should be done at a higher level than a single field, by the time you&amp;rsquo;ve acquired whatever object has the property on it, it should already be safe to read it.&lt;/li&gt;
&lt;li&gt;Accessing the property should not do any I/O, especially not any network I/O, again see above, by the time you&amp;rsquo;re reading the property the object offering it should have done whatever I/O was needed.&lt;/li&gt;
&lt;li&gt;Accessing the property should not be an operation with complexity greater than O(1) &amp;ndash; that means no loops.&amp;nbsp; At all.&amp;nbsp; You could haggle me as high as O(lg(N)) if we&amp;rsquo;re talking about an property that is an &amp;ldquo;indexer&amp;rdquo; but no higher.&lt;/li&gt;
&lt;li&gt;Accessing the property should not have side-effects (i.e. it's strictly a read operation, it changes nothing)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;What you&amp;rsquo;re left with is you can use your object state and the argument (if an indexer) to do a constant-time lookup, or log-time at worst, in an already existing data structure and immediately return the result.&amp;nbsp; That&amp;rsquo;s it.&lt;/p&gt;
&lt;p&gt;Why?&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/b/brada/archive/2003/10/02/50420.aspx"&gt;Pit of Success&lt;/a&gt; is the only reason you need.&amp;nbsp; In my opinion, patterns more complicated than the above are doomed to fail.&amp;nbsp; If you allow say network access, an RPC or the like, on each property fetch, then you promote things like field-at-a-time access to remote data.&amp;nbsp; Not only is this astonishing to users of the API it is incredibly inefficient.&amp;nbsp; If you follow the rules above you soon realize that you must allow some kind of query to get the data you need and then you can use properties all you like to access that data.&amp;nbsp; That is a much better pattern, it leads to success.&lt;/p&gt;
&lt;p&gt;Remember that if you allow things like I/O or synchronization you can easily get property access times that are measured in milliseconds, this simply will not do.&amp;nbsp; A typical interactive scenario might have a budget of say 100ms for prompt response and it might require access to several dozen properties just to paint the screen properly.&amp;nbsp; This has several issues:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;If property access is say 1 millisecond then accessing 10 properties (not at all crazy) would be 10% of your overall budget &amp;ndash; that&amp;rsquo;s nuts!&lt;/li&gt;
&lt;li&gt;The interactive code must be able to use your properties with confidence, that means they cannot block and should not be subject to large variability, else you get UI that is non-responsive for extended periods of time&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Frequent access to properties is very common and therefore must be astonishingly cheap if only to keep a handle on the Joules your program consumes &amp;ndash; an increasingly important metric for modern platforms.&lt;/p&gt;
&lt;p&gt;From a time perspective, I like to see properties that have access time measured in nanoseconds.&amp;nbsp; Let&amp;rsquo;s say 10^-8s.&amp;nbsp; I can reasonably see systems with tricky indexing that might go has high as 10^-7 or even 10^-6.&amp;nbsp; When your time is getting to be 10^-5 or larger, you really need to start thinking about your design.&amp;nbsp; That&amp;rsquo;s too much work to put inside a thing that looks like a field access.&amp;nbsp; Give your users a fighting chance to understand where their costs are and let them query for a batch of results, probably asynchronously and then access them quickly when they arrive.&amp;nbsp; That&amp;rsquo;s going to be a successful pattern.&lt;/p&gt;
&lt;p&gt;It goes without saying that under these conditions, the flexibility to version/replace/subtype virtual-call properties is actually illusory.&amp;nbsp; If you were to try to do something new and costly, or even just very different in a subtype you would likely cause all manner of problems for callers.&amp;nbsp; So while you do get to change things a somewhat, you cannot and must not, use that flexibility to access new and different subsystems or the like inside of a method that is supposed to be as small as a getter.&amp;nbsp; You are necessarily very constrained.&lt;/p&gt;
&lt;p&gt;When I consider all of this I arrive squarely at the conclusion that more fields and fewer properties would be better.&amp;nbsp; Don&amp;rsquo;t hide real work inside a property and don&amp;rsquo;t use them as a synchronization tool.&amp;nbsp; Once you decide that you need a fetch/read pattern you soon find that that reading thing can be very simple/fast indeed and that perhaps fields were just fine after all.&lt;/p&gt;
&lt;p&gt;Something to think about anyway.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10249339" width="1" height="1"&gt;</content><author><name>ricom</name><uri>http://blogs.msdn.com/ricom/ProfileUrlRedirect.ashx</uri></author><category term="performance" scheme="http://blogs.msdn.com/b/ricom/archive/tags/performance/" /><category term="design advice" scheme="http://blogs.msdn.com/b/ricom/archive/tags/design+advice/" /></entry><entry><title>Going to Internet Explorer</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/ricom/archive/2011/11/12/going-to-internet-explorer.aspx" /><id>http://blogs.msdn.com/b/ricom/archive/2011/11/12/going-to-internet-explorer.aspx</id><published>2011-11-12T17:21:00Z</published><updated>2011-11-12T17:21:00Z</updated><content type="html">&lt;p&gt;Many of you have commented that I've been kind of quiet lately.&amp;nbsp; This was largely a reflection of my job, I was working on an internal team that I could not write much about for the last couple of years.&amp;nbsp; I had a great experience there but that trek is now coming to an end.&amp;nbsp; In a few days I'll be working on Internet Explorer and back in the thick of the public facing products.&amp;nbsp; IE is a very exciting place to be and I'm sure it will be loaded with issues I can write about that will be of general interest without giving away product plans and so forth.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I hope to be writing a lot more&amp;nbsp;in the coming months.&lt;/p&gt;
&lt;p&gt;Thank you for your support over the years :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10236482" width="1" height="1"&gt;</content><author><name>ricom</name><uri>http://blogs.msdn.com/ricom/ProfileUrlRedirect.ashx</uri></author><category term="ramblings" scheme="http://blogs.msdn.com/b/ricom/archive/tags/ramblings/" /></entry><entry><title>Measure!</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/ricom/archive/2011/09/20/measure.aspx" /><id>http://blogs.msdn.com/b/ricom/archive/2011/09/20/measure.aspx</id><published>2011-09-20T19:41:12Z</published><updated>2011-09-20T19:41:12Z</updated><content type="html">&lt;p&gt;I know I haven't posted for a while; I'm hoping that will change soon.&amp;nbsp; However in the mean time my daughter forwarded me this link because she thought it was cute.&lt;/p&gt;
&lt;p&gt;The thing is, she didn't realize it should be my theme song.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.youtube.com/watch?v=MMsQYjYlBEo"&gt;http://www.youtube.com/watch?v=MMsQYjYlBEo&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It's rule #1&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/b/ricom/archive/2003/12/02/40779.aspx"&gt;http://blogs.msdn.com/b/ricom/archive/2003/12/02/40779.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Now even Sesame Street agrees!&amp;nbsp; It must be right!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10214228" width="1" height="1"&gt;</content><author><name>ricom</name><uri>http://blogs.msdn.com/ricom/ProfileUrlRedirect.ashx</uri></author><category term="performance" scheme="http://blogs.msdn.com/b/ricom/archive/tags/performance/" /><category term="recommendations" scheme="http://blogs.msdn.com/b/ricom/archive/tags/recommendations/" /></entry><entry><title>Less Loosely Coupled Than Meets The Eye</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/ricom/archive/2010/09/27/less-loosely-coupled-than-meets-the-eye.aspx" /><id>http://blogs.msdn.com/b/ricom/archive/2010/09/27/less-loosely-coupled-than-meets-the-eye.aspx</id><published>2010-09-28T04:35:00Z</published><updated>2010-09-28T04:35:00Z</updated><content type="html">&lt;p&gt;I don&amp;rsquo;t know that it is possible to write anything like a unitary software system in a way that is truly loosely coupled.&amp;nbsp;&amp;nbsp; It&amp;rsquo;s not&amp;nbsp;that you can&amp;rsquo;t make boxes and lines that are cleanly separated in all sorts of pretty ways, though that&amp;rsquo;s hard enough.&amp;nbsp; The problem is that even if you manage to do that, what you end up with is actually still pretty tightly coupled.&lt;/p&gt;
&lt;p&gt;What do I mean?&lt;/p&gt;
&lt;p&gt;Well, let me use Visual Studio as an example.&amp;nbsp; It&amp;rsquo;s made up of all kinds of extensions which communicate through formal interfaces.&amp;nbsp; Putting aside the warts and just looking at how it was intended to work it seems pretty good.&amp;nbsp; You can make and replace pieces independently, there is a story for how now features light up; it&amp;rsquo;s all pretty good.&amp;nbsp; Yes, it could be better but let&amp;rsquo;s for the moment idealize what is there.&amp;nbsp; But is it loosely coupled, really?&lt;/p&gt;
&lt;p&gt;Well the answer is heck no.&lt;/p&gt;
&lt;p&gt;These systems all share resources in fundamental ways that actually tie them together pretty tightly.&amp;nbsp; It starts with the address space, each extension can be victimized by the others, and it goes on.&amp;nbsp; In fact every important resource on the machine is subject to direct interference between nominally isolated extensions.&amp;nbsp; Is this avoidable?&lt;/p&gt;
&lt;p&gt;I don&amp;rsquo;t think it is actually.&amp;nbsp; I think unitary software systems are fundamentally tightly coupled when you look at them through a performance lens.&amp;nbsp; And that is why I&amp;rsquo;m so often telling people that they need to look at their overall system and see if, when it&amp;rsquo;s all put together, it has any hope of working the way you want.&amp;nbsp; Two subsystems that both (loosely) use 2/3 of the L2 cache are going to use 4/3 of a cache&amp;hellip; that&amp;rsquo;s not good.&amp;nbsp; There may be no lines between them in the architecture diagram but they are going to destroy each others ability to work.&lt;/p&gt;
&lt;p&gt;So, does that about wrap it up for agile then?&amp;nbsp; Should we just waterfall our way to victory?&lt;/p&gt;
&lt;p&gt;Hardly.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Everything you&amp;rsquo;ve ever read about requirements changing and not over-designing systems that are loosely specified (much less loosely coupled) still applies, but just because you&amp;rsquo;re going agile and you want to keep your flexibility is no reason to not think about what it&amp;rsquo;s all going to look like when you put it all together.&amp;nbsp; Some kind of blend is needed.&lt;/p&gt;
&lt;p&gt;If you do run into problems that loose architecture is going to help you.&amp;nbsp; But waiting until you&amp;rsquo;re done and counting on your agility to save you at the finish line isn&amp;rsquo;t so smart either.&amp;nbsp; Agile development doesn&amp;rsquo;t prohibit you from planning out the parts that need planning and understanding your key constraints.&amp;nbsp; In fact I think it encourages this &amp;ndash; knowing your constraints keeps you honest and lets you make adjustments smartly as you go.&lt;/p&gt;
&lt;p&gt;Performance is never loosely coupled.&amp;nbsp; Don&amp;rsquo;t be fooled by your diagram, the profiler doesn&amp;rsquo;t know where your little boxes and lines are.&amp;nbsp; Trust me :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10068529" width="1" height="1"&gt;</content><author><name>ricom</name><uri>http://blogs.msdn.com/ricom/ProfileUrlRedirect.ashx</uri></author><category term="performance" scheme="http://blogs.msdn.com/b/ricom/archive/tags/performance/" /><category term="design advice" scheme="http://blogs.msdn.com/b/ricom/archive/tags/design+advice/" /></entry><entry><title>Debugging Multi-threaded Applications: Some Tidbits</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/ricom/archive/2010/06/04/debugging-multi-threaded-applications-some-tidbits.aspx" /><id>http://blogs.msdn.com/b/ricom/archive/2010/06/04/debugging-multi-threaded-applications-some-tidbits.aspx</id><published>2010-06-04T20:06:00Z</published><updated>2010-06-04T20:06:00Z</updated><content type="html">&lt;p&gt;I was lamenting that we haven't really done terribly much to make multi-threaded debugging easier in say the last decade and I was fortunate enough to be able to have a conversation with Brain Crawford about it.&amp;nbsp;&amp;nbsp; Brian is a long-time friend an colleague, we worked on the VC++ debugger years ago, he's the lead architect for all things debugger these days.&amp;nbsp; Anyway, he gave me this succinct information about VS2010 and was kind enough to allow me to share it with you all.&lt;/p&gt;
&lt;p&gt;In his own words Brian writes:&lt;/p&gt;
&lt;p&gt;While I agree that there is more we could do to make multi-threaded debugging even better, VS 2010 has a number of features that help with multi-threaded debugging for both native and managed code:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Stepping has affinity with the thread being stepped. Whatever thread is active (has the yellow IP marker next to it in the Threads window) will be stepped and no other threads will complete the step started on that thread. However, by default, breakpoints will fire on any thread, so you can step one thread and hit a breakpoint on another. &lt;/li&gt;
&lt;li&gt;Any time you started execution (step or go) on a thread and execution stops on another thread (e.g. you hit a breakpoint or exception), there will be a small blue marker overlaid on the yellow IP arrow shown in source code to indicate a thread switch occurred.&lt;/li&gt;
&lt;li&gt;Per thread breakpoints can be created by setting a breakpoint and then right clicking on the breakpoint glyph and choosing Filter. In the Filter dialog, you can enter an expression like &amp;ldquo;ThreadId=5&amp;rdquo; to restrict the breakpoint to a particular thread.&lt;/li&gt;
&lt;li&gt;The threads window in VS 2010 has a number of features to help manage multiple threads:
&lt;ul&gt;
&lt;li&gt;Threads can be flagged manually so it&amp;rsquo;s easy to find the subset of threads you&amp;rsquo;re currently working with.&lt;/li&gt;
&lt;li&gt;Threads can be flagged according to just my code or by particular modules.&lt;/li&gt;
&lt;li&gt;Call stacks for each thread can be viewed by hovering over the Location cell or the call stack can viewed inline by expanding the Location cell (so multiple call stacks can be viewed simultaneously).&lt;/li&gt;
&lt;li&gt;Threads can be grouped according to different criteria, such as process, name, category, flag, etc.&lt;/li&gt;
&lt;li&gt;Threads, including the call stacks for each thread, can be searched using the search box in the window. For example, if you&amp;rsquo;re looking for all threads with Foo on the stack, enable Search Call Stack, and type Foo in the Search box.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For multiple threads running the same/similar workload, the new Parallel Stacks view is very useful. While primarily designed for use with the parallel libraries and runtime, it can also be useful for traditional multi-threaded debugging. It consolidates threads with common stacks into a &amp;ldquo;cactus stack&amp;rdquo; view. I don&amp;rsquo;t know the kinds of scenarios you&amp;rsquo;re debugging, but it might be worth checking out. Here&amp;rsquo;s some additional info on this view: &lt;a href="http://msdn.microsoft.com/en-us/library/dd998398.aspx"&gt;http://msdn.microsoft.com/en-us/library/dd998398.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Thank you Brian, and please get a blog soon :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10020220" width="1" height="1"&gt;</content><author><name>ricom</name><uri>http://blogs.msdn.com/ricom/ProfileUrlRedirect.ashx</uri></author><category term="debuggers" scheme="http://blogs.msdn.com/b/ricom/archive/tags/debuggers/" /><category term="visual studio" scheme="http://blogs.msdn.com/b/ricom/archive/tags/visual+studio/" /></entry><entry><title>A few words about Micro-Benchmarks</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/ricom/archive/2010/04/26/a-few-words-about-micro-benchmarks.aspx" /><id>http://blogs.msdn.com/b/ricom/archive/2010/04/26/a-few-words-about-micro-benchmarks.aspx</id><published>2010-04-27T00:57:00Z</published><updated>2010-04-27T00:57:00Z</updated><content type="html">&lt;P&gt;It’s been a long time since I included my “this discussion is only approximately correct” disclaimer so I’ll just preface it here.&amp;nbsp; In the interest of space and clarity, this discussion is only approximately correct.&amp;nbsp; OK, now we can move on…&lt;/P&gt;
&lt;P&gt;&lt;BR&gt;I love micro-benchmarks. &lt;/P&gt;
&lt;P&gt;&lt;BR&gt;Really.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&lt;BR&gt;I rely on micro-benchmarks to help me understand what is going on in my system on a day to day or even build to build basis.&amp;nbsp; Understanding which micro-benchmarks are really vital is essential to keeping your performance under control.&amp;nbsp; But you have to be careful not to do more than this.&lt;/P&gt;
&lt;P&gt;&lt;BR&gt;One thing you should never do is use your micro-benchmarks to drive prioritization of your performance problems.&amp;nbsp; Remember, a micro-benchmark’s mission in life is to magnify some aspect of your programs performance.&amp;nbsp; Because of this anyone can readily generate a micro-benchmark that makes any given issue seem like a major problem.&amp;nbsp; Do not be fooled!&amp;nbsp; Micro-benchmarks in-and-of-themselves tell you almost nothing about what is important.&amp;nbsp; What they help you do is manage and track the important things once you have discovered them with representative workloads.&lt;/P&gt;
&lt;P&gt;&lt;BR&gt;Once you have established which micro-benchmarks are key performance drivers in your system, you can use this to help you make progress on the large problems more quickly, but you must be careful to re-validate.&amp;nbsp; Seemingly positive-looking changes in the micro-benchmark can easily be negative under your real workload because the micro-benchmark is often much less resource constrained.&amp;nbsp; For instance, you could make a change that doubles your metric at the expense of addition L2 cache usage.&amp;nbsp; That might be a good thing but it could also be a disaster, the collateral damage you would do to the rest of the program could easily erase all those gains.&lt;/P&gt;
&lt;P&gt;&lt;BR&gt;So, should you use these quick running scenarios? Yes, but certainly not exclusively. And not as the primary planning tool, but as a planning aid.&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10002873" width="1" height="1"&gt;</content><author><name>ricom</name><uri>http://blogs.msdn.com/ricom/ProfileUrlRedirect.ashx</uri></author><category term="performance" scheme="http://blogs.msdn.com/b/ricom/archive/tags/performance/" /><category term="design advice" scheme="http://blogs.msdn.com/b/ricom/archive/tags/design+advice/" /></entry><entry><title>My History of Visual Studio (Epilog)</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/ricom/archive/2010/04/14/my-history-of-visual-studio-epilog.aspx" /><id>http://blogs.msdn.com/b/ricom/archive/2010/04/14/my-history-of-visual-studio-epilog.aspx</id><published>2010-04-14T19:19:00Z</published><updated>2010-04-14T19:19:00Z</updated><content type="html">&lt;P&gt;&lt;A href="http://www.microsoft.com/visualstudio/en-us/watch-it-live" mce_href="http://www.microsoft.com/visualstudio/en-us/watch-it-live"&gt;Visual Studio 2010 Launched on Monday&lt;/A&gt;.&amp;nbsp; Wow!&amp;nbsp; It’s HUGE.&amp;nbsp; A major round of congratulations are in order for everyone involved, not just on the Visual Studio team but also on the Frameworks team and the supporting teams and of course the customers whose feedback was so vital to the success of the product.&lt;/P&gt;
&lt;P&gt;I’ve already written a lot about &lt;A href="http://en.wikipedia.org/wiki/Visual_studio#Visual_Studio_2010" mce_href="http://en.wikipedia.org/wiki/Visual_studio#Visual_Studio_2010"&gt;VS2010&lt;/A&gt; previously in &lt;A href="http://blogs.msdn.com/ricom/archive/tags/History+of+Visual+Studio/default.aspx" mce_href="http://blogs.msdn.com/ricom/archive/tags/History+of+Visual+Studio/default.aspx"&gt;the series&lt;/A&gt; and I don’t want to go over all that stuff again.&amp;nbsp; In my &lt;A href="http://blogs.msdn.com/ricom/archive/2009/10/19/my-history-of-visual-studio-part-10-final.aspx" mce_href="http://blogs.msdn.com/ricom/archive/2009/10/19/my-history-of-visual-studio-part-10-final.aspx"&gt;last history posting&lt;/A&gt;, back when Beta 2 came out, I covered all the major things that we wanted to get into this version of Visual Studio from an architectural perspective.&amp;nbsp; You could look down &lt;A href="http://blogs.msdn.com/ricom/archive/2009/10/19/my-history-of-visual-studio-part-10-final.aspx" mce_href="http://blogs.msdn.com/ricom/archive/2009/10/19/my-history-of-visual-studio-part-10-final.aspx"&gt;that list&lt;/A&gt; and get a feel for whether or not the release was a success from that perspective. I think key architectural features like a full WPF surface, MEF extensibility, extension management generally, and of course multi-targeting were delivered.&amp;nbsp; General purpose multi-targeting is a huge thing because it means we don’t have to do a VS SKU release for every new target platform that comes out – that was a critical thing for our own sanity.&amp;nbsp; And WPF has certainly (finally?) proved itself as a viable platform for a flagship application.&amp;nbsp; We set out on a multi-release remodeling plan and I think we delivered an excellent first-installment.&lt;/P&gt;
&lt;P&gt;You might be wondering why I was so quiet during the home stretch. I’m afraid my perspective on the VS RC and RTM milestones was an outsider's.&amp;nbsp; The Beta 2 push was my last major hands-on involvement with the product; probably the simplest diagnosis is that I burned myself out at that point.&amp;nbsp; In any case I took a vacation after that Beta with the goal of returning to find a new challenge.&amp;nbsp; I’d been in the Developer Division about 7 years, for the second time, and I like to move around about that often, so it was time.&amp;nbsp; I’d love to take some credit for fixing the daunting memory leaks that were left in Beta 2 but I’m afraid all credit for that goes to my capable colleagues to whom I am forever grateful for taking this particular release across the finish line.&lt;/P&gt;
&lt;P&gt;Some things were lost on the way in the name of getting the necessary stability and basically locking things down.&amp;nbsp; It’s kind of a sad thing when that happens but it’s a necessary thing – they’ll just have to wait for the service release.&amp;nbsp; Nearly ready to go things that just needed a little more bake time are a great thing to have in your pocket at that point, but there are a few especially delightful things that I wanted to mention, sort of unexpectedly delightful, for me anyway.&lt;/P&gt;
&lt;P&gt;We started with an ambitious goal to make a major dent in Visual Studio’s setup experience.&amp;nbsp; A lot of what we wanted to do ended up having to be pared back and I feared we would end up making little progress but in the final analysis I think the setup experience is substantially better.&amp;nbsp; Seeing tweets on how people had successfully installed in less than 30 minutes was very nice.&amp;nbsp; More than I hoped for in the darkest hours.&amp;nbsp; My own experiences during the beta were the best of any VS release I’ve ever installed – and that’s a lot of releases.&lt;/P&gt;
&lt;P&gt;I feared the historical debugging feature, &lt;A href="http://msdn.microsoft.com/en-us/library/dd264915.aspx" mce_href="http://msdn.microsoft.com/en-us/library/dd264915.aspx"&gt;IntelliTrace&lt;/A&gt;, was going to be too bulky to use all the time but that’s not proving to be the case at all.&amp;nbsp; I’m just getting used to having it available all the time and it’s proving to be much more of a game-changer than I ever imagined.&amp;nbsp; I wrote more about the history of that feature previously so I won’t go on other than to give some kudos to those that worked hard to make that feature reality.&lt;/P&gt;
&lt;P&gt;I didn’t think TFS was going to be so universally important but the ease with which &lt;A href="http://blogs.msdn.com/bharry/archive/2009/10/01/tfs-2010-for-sourcesafe-users.aspx" mce_href="http://blogs.msdn.com/bharry/archive/2009/10/01/tfs-2010-for-sourcesafe-users.aspx"&gt;TFS Basic&lt;/A&gt; can be brought online was just staggering.&amp;nbsp; In just a few minutes I configured my own home TFS installation – it’s great to have that kind of quality ALM system so easily available to everyone.&lt;/P&gt;
&lt;P&gt;The rate at which new extensions are appearing in the gallery is incredible.&amp;nbsp; I’m so glad to see &lt;A href="http://visualstudiogallery.msdn.microsoft.com/en-us/" mce_href="http://visualstudiogallery.msdn.microsoft.com/en-us/"&gt;this hub&lt;/A&gt; creating energy for all our customers, but there was one extension in particular that made my day.&amp;nbsp; &lt;A href="http://visualstudiogallery.msdn.microsoft.com/en-us/site/profile?userName=kolomiets" mce_href="http://visualstudiogallery.msdn.microsoft.com/en-us/site/profile?userName=kolomiets"&gt;Dmitry Kolomiets&lt;/A&gt; produced, I think, the first &lt;A href="http://visualstudiogallery.msdn.microsoft.com/en-us/66350dbe-ed01-4120-bea2-5564eff7b0b2" mce_href="http://visualstudiogallery.msdn.microsoft.com/en-us/66350dbe-ed01-4120-bea2-5564eff7b0b2"&gt;Solution Load Manager&lt;/A&gt; extension.&amp;nbsp; Why do I care so much about that particular extension?&amp;nbsp; Well there’s a story there: from very early on in the history of VS2010 I was espousing a philosophy that we could not universally load every project in a solution and achieve our memory goals – many solutions are just too large and it’s entirely normal to not need every project.&amp;nbsp; But there is no reasonable way to manage solutions.&amp;nbsp; Unfortunately there was just not enough time to make this feature a reality – but there was enough time to add the necessary APIs so that a 3rd party could make us load less and manage what was loaded.&amp;nbsp; With that support they could build their own UI to drive the experience.&amp;nbsp; It was hoped that the performance benefits from such a system would motivate the creation of a variety of managers with different policies – potentially tied in to the great refactoring engines engines already out there (e.g. &lt;A href="http://en.wikipedia.org/wiki/Coderush" mce_href="http://en.wikipedia.org/wiki/Coderush"&gt;CodeRush&lt;/A&gt; and &lt;A href="http://en.wikipedia.org/wiki/ReSharper" mce_href="http://en.wikipedia.org/wiki/ReSharper"&gt;Resharper&lt;/A&gt;).&amp;nbsp; But it was just a hope.&amp;nbsp; Now there is one!&lt;/P&gt;
&lt;P&gt;I could go on for ages.&amp;nbsp; The &lt;A href="http://blogs.msdn.com/camerons/archive/2008/12/16/introduction-to-directed-graph-markup-language-dgml.aspx" mce_href="http://blogs.msdn.com/camerons/archive/2008/12/16/introduction-to-directed-graph-markup-language-dgml.aspx"&gt;diagramming support&lt;/A&gt; and of course our uses of it.&amp;nbsp; Integrated Silverlight support, ASP.NET 4 with MVC2 (read about it on &lt;A href="http://weblogs.asp.net/scottgu/archive/2010/04/12/visual-studio-2010-and-net-4-released.aspx" mce_href="http://weblogs.asp.net/scottgu/archive/2010/04/12/visual-studio-2010-and-net-4-released.aspx"&gt;Scott’s Blog&lt;/A&gt;).&amp;nbsp; Language improvements in C#, VB, and C++.&amp;nbsp; Did I mention &lt;A href="http://visualstudiomagazine.com/articles/2010/04/01/using-visual-studio-2010.aspx" mce_href="http://visualstudiomagazine.com/articles/2010/04/01/using-visual-studio-2010.aspx"&gt;Windows Azure&lt;/A&gt; support as well?&amp;nbsp; &lt;A href="http://msdn.microsoft.com/en-us/library/ee330921.aspx" mce_href="http://msdn.microsoft.com/en-us/library/ee330921.aspx"&gt;Sharepoint&lt;/A&gt; support? &lt;A href="http://blogs.msdn.com/somasegar/archive/2009/10/09/f-in-vs2010.aspx" mce_href="http://blogs.msdn.com/somasegar/archive/2009/10/09/f-in-vs2010.aspx"&gt;F#&lt;/A&gt;?&amp;nbsp; It’s huge.&lt;/P&gt;
&lt;P&gt;This was only “My” History of Visual of Visual Studio.&amp;nbsp; For me this is the "epilog" but for everyone else, VS2010 out the door, it’s time to begin your own History.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Congratulations and Enjoy!&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9996078" width="1" height="1"&gt;</content><author><name>ricom</name><uri>http://blogs.msdn.com/ricom/ProfileUrlRedirect.ashx</uri></author><category term="visual studio" scheme="http://blogs.msdn.com/b/ricom/archive/tags/visual+studio/" /><category term="History of Visual Studio" scheme="http://blogs.msdn.com/b/ricom/archive/tags/History+of+Visual+Studio/" /></entry><entry><title>Variability in Benchmarks</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/ricom/archive/2010/04/07/variability-in-benchmarks.aspx" /><id>http://blogs.msdn.com/b/ricom/archive/2010/04/07/variability-in-benchmarks.aspx</id><published>2010-04-07T22:43:00Z</published><updated>2010-04-07T22:43:00Z</updated><content type="html">&lt;P&gt;I’m not especially a great fan of micro-benchmarks, they’re handy as a compliment to the larger tests but I often find that they lead to confusion because they are interpreted as reflecting reality when nothing could be farther from the truth.&amp;nbsp; The fact is that micro-benchmarks are intended to magnify some particular phenomenon to allow it to be studied.&amp;nbsp; You can expect that normal things like cache pressure, even memory consumption generally, will be hidden – often on purpose for a particular test or tests.&amp;nbsp; Nonetheless many people, including me, feel more comfortable when there is a battery of micro-benchmarks to back up the “real” tests because micro-benchmarks are much more specific and therefore more actionable.&lt;/P&gt;
&lt;P&gt;However, benchmarks in general have serious stability issues.&amp;nbsp; Sometimes even run-to-run stability over the same test bits is hard to achieve.&amp;nbsp; I have some words of caution regarding the variability of results in micro-benchmarks, and benchmarks generally. &lt;/P&gt;
&lt;P&gt;Even if you do your best to address the largest sources of &lt;EM&gt;internal variability&lt;/EM&gt; in a benchmark by techniques like controlling GCs, adequate warm-up, synchronizing participating processes, making sensible affinity choices, and whatnot,&amp;nbsp;you are still left with significant sources of what I will call &lt;EM&gt;external variability&lt;/EM&gt;.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;The symptom of &lt;EM&gt;external variability&lt;/EM&gt; is that you’ll get a nice tight results from your benchmark (a good benchmark might have a &lt;A class="" href="http://en.wikipedia.org/wiki/Coefficient_of_variation" mce_href="http://en.wikipedia.org/wiki/Coefficient_of_variation"&gt;Coefficient of&amp;nbsp;Variation&lt;/A&gt; of well below 1%) but the observed result is much slower (or, rarely, faster) than a typical run.&amp;nbsp; The underlying cause varies, some typical ones are:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Scheduler variability – the scheduler makes an unfortunate choice and sticks with it&lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;The entire run is much slower than normal&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;Uncontrolled background activity external to the test&lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;Part of the run is slower, maybe several consecutive test cases in a suite&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;Interference from attached devices&lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;Incoming network packets or other sources of interrupts&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;
&lt;P&gt;These problems are often not the dominant sources of variability initially but as the benchmark is improved, controlling for other factors, they become dominant.&lt;/P&gt;
&lt;P&gt;Statistically the underlying issue is this:&amp;nbsp; repeated benchmark measurements in a run are &lt;EM&gt;&lt;STRONG&gt;not&lt;/STRONG&gt;&lt;/EM&gt; independent: a phenomenon affecting a particular iteration is highly likely to also affect the next iteration.&amp;nbsp; A closer statistical model might be independent measurements punctuated by a &lt;A class="" href="http://en.wikipedia.org/wiki/Poisson_process" mce_href="http://en.wikipedia.org/wiki/Poisson_process"&gt;Poisson Process&lt;/A&gt; that produces long lasting disruptions.&amp;nbsp; "Waiter, there is a fish in my benchmark."&lt;/P&gt;
&lt;P&gt;My experience with this sort of thing, and I expect the battle-scarred will agree, is that reducing external variability is an ongoing war.&amp;nbsp; There isn’t really a cure.&amp;nbsp; But it does pay to not have hair-trigger reflex on regression warnings, and to screen for false positives in your results.&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9992048" width="1" height="1"&gt;</content><author><name>ricom</name><uri>http://blogs.msdn.com/ricom/ProfileUrlRedirect.ashx</uri></author><category term="performance" scheme="http://blogs.msdn.com/b/ricom/archive/tags/performance/" /></entry><entry><title>My Annual Personal Posting</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/ricom/archive/2010/04/05/my-annual-personal-posting.aspx" /><id>http://blogs.msdn.com/b/ricom/archive/2010/04/05/my-annual-personal-posting.aspx</id><published>2010-04-06T06:26:00Z</published><updated>2010-04-06T06:26:00Z</updated><content type="html">&lt;P&gt;I try to keep the content on this blog strictly professional (although sometimes it's like an editorial but at least it's topical) About once a year I break down and write something that's basically just some personal thing I felt like sharing.&amp;nbsp;This is my link for this year.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;A couple of years ago my family became involved in animal rescue (mainly cats and dogs).&amp;nbsp; It all started when my wife asked me if we could get a third dog and I told her that was a bad idea -- "too many" I said.&amp;nbsp; But I thought fostering would be a good thing.&amp;nbsp; Ha!&amp;nbsp; I had no idea I was saying "no" to three and now sometimes we have nine in the house!&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Still it was the best stupid thing I ever said.&lt;/P&gt;
&lt;P&gt;One of the organizations our family is associated with is Furbaby Rescue here in Washington.&amp;nbsp; If you are a pet person, or think you might like to be one some day, I invite you to watch this.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.youtube.com/watch?v=YExxNEpEdJY"&gt;http://www.youtube.com/watch?v=YExxNEpEdJY&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Warning: it's quite sad as are many of&amp;nbsp;rescue stories.&amp;nbsp; But I hope this one has a happy ending when all is said and done.&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9990965" width="1" height="1"&gt;</content><author><name>ricom</name><uri>http://blogs.msdn.com/ricom/ProfileUrlRedirect.ashx</uri></author><category term="ramblings" scheme="http://blogs.msdn.com/b/ricom/archive/tags/ramblings/" /></entry><entry><title>Why you really want to avoid catching and rethrowing exceptions</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/ricom/archive/2010/04/05/why-you-really-want-to-avoid-catching-and-rethrowing-exceptions.aspx" /><id>http://blogs.msdn.com/b/ricom/archive/2010/04/05/why-you-really-want-to-avoid-catching-and-rethrowing-exceptions.aspx</id><published>2010-04-05T19:18:00Z</published><updated>2010-04-05T19:18:00Z</updated><content type="html">&lt;P&gt;I like processes that simply drop-dead fail when they have an unrecoverable fault.&amp;nbsp; Trying to continue is often dangerous and unlikely to actually help anyone.&amp;nbsp; This policy is all fine and well but in all cases it is vital that the “death” stack of a process be the true problem, not a generic error handler.&amp;nbsp; Those kinds of handlers ruin the lives of developers who are trying to analyze error logs, and effectively make services like Watson useless.&amp;nbsp; I can’t stress enough how critical it is to NOT mess with the failure stack.&lt;/P&gt;
&lt;P&gt;I’ve seen many of these in the wild, including of course Microsoft code, and it means that instead of getting a nice actionable stack in the log (which would have been a Watson report in the field) you have to go back to the code and try to repro.&amp;nbsp; In the case below I stared at the source for a while trying to figure out what was likely wrong and it turned out the true problem was quite distant from the likely candidates.&lt;/P&gt;
&lt;P&gt;2010/04/05 11:02:14 AM&amp;nbsp; BEGIN&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek_Range TEST&lt;BR&gt;2010/04/05 11:02:14 AM&amp;nbsp; ---- Exception in [StackTest] thrown type=[TestCodeException], eip=[00000004`4716C93E], message=[Index (1) is out-of-range [0..1]!]&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;That was the failure right there, and that stack was the one I needed! Nothing after that should have happened... But... execution continues until finally....&lt;/P&gt;
&lt;P&gt;2010/04/05 11:02:15 AM&amp;nbsp; Test completed exceptionally [Peek_Range]: Index (1) is out-of-range [0..1]!&lt;/P&gt;
&lt;P&gt;The stack reported at this point is useless… the real problem was millions of cycles ago.&amp;nbsp; I'm not even including&amp;nbsp;the stack from the log&amp;nbsp;because it's just stupid.&lt;/P&gt;
&lt;P&gt;The real stack can be extracted with a repro (at great pain)&lt;/P&gt;
&lt;P&gt;And it ends up looking something like&amp;nbsp;this (cleaned up)&lt;/P&gt;
&lt;P&gt;StackTest!TestUtilities::ParamCheckIndex&amp;lt;int32&amp;gt;&lt;BR&gt;StackTest!CollectionTestUtils::TestUtilities_SimpleList&amp;lt;int&amp;gt;::RangeCheckIndex&lt;BR&gt;StackTest!CollectionTestUtils::TestUtilities_SimpleList&amp;lt;int&amp;gt;::get_Item&lt;/P&gt;
&lt;P&gt;The actual problem is in the test code!&amp;nbsp;&amp;nbsp; The only useful information from the original log was basically the test that I should run.&amp;nbsp; Thank goodness it’s a 100% repro.&lt;BR&gt;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9990729" width="1" height="1"&gt;</content><author><name>ricom</name><uri>http://blogs.msdn.com/ricom/ProfileUrlRedirect.ashx</uri></author><category term="design advice" scheme="http://blogs.msdn.com/b/ricom/archive/tags/design+advice/" /></entry><entry><title>VSX Keynote posted</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/ricom/archive/2009/12/08/vsx-keynote-posted.aspx" /><id>http://blogs.msdn.com/b/ricom/archive/2009/12/08/vsx-keynote-posted.aspx</id><published>2009-12-09T01:55:00Z</published><updated>2009-12-09T01:55:00Z</updated><content type="html">&lt;P&gt;Just a quick plug, if you missed the VSX conference you can see it all online on Channel 9.&amp;nbsp; Some great talks including my &lt;A href="http://channel9.msdn.com/posts/VSIPMarketing/VSX100-Visual-Studio-Extensibility-Keynote-Past-Present-and-Future/" mce_href="http://channel9.msdn.com/posts/VSIPMarketing/VSX100-Visual-Studio-Extensibility-Keynote-Past-Present-and-Future/"&gt;keynote speech&lt;/A&gt; on VS Futures.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9934360" width="1" height="1"&gt;</content><author><name>ricom</name><uri>http://blogs.msdn.com/ricom/ProfileUrlRedirect.ashx</uri></author><category term="recommendations" scheme="http://blogs.msdn.com/b/ricom/archive/tags/recommendations/" /></entry><entry><title>VS2010 Beta2 performance and other issues</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/ricom/archive/2009/10/28/vs2010-beta2-performance-and-other-issues.aspx" /><id>http://blogs.msdn.com/b/ricom/archive/2009/10/28/vs2010-beta2-performance-and-other-issues.aspx</id><published>2009-10-28T20:08:00Z</published><updated>2009-10-28T20:08:00Z</updated><content type="html">&lt;P&gt;Just a few words of encouragement today:&amp;nbsp; I can't emphasize enough how valueable your feedback is to us at this point; no matter how hard we try we simply cannot duplicate the diversity that is the real world.&amp;nbsp; We need to know what's really working out there -- what works for us isn't enough.&amp;nbsp; Whether it's performance, stability, or any other issue, your feedback will help us to "get it right" for the release.&lt;/P&gt;
&lt;P&gt;I've seen some super-positive comments about product performance and I've seen some negative ones.&amp;nbsp; Your comments will help us to figure out which areas we've missed, what combinations aren't working, what hardware are we using poorly, or any other goofy thing we might have done.&lt;/P&gt;
&lt;P&gt;You can use &lt;A href="http://connect.microsoft.com/" mce_href="http://connect.microsoft.com/"&gt;http://connect.microsoft.com/&lt;/A&gt;&amp;nbsp;or you can provide comments here.&amp;nbsp; We're even watching twitter and the blog-o-sphere generally but those are less reliable.&lt;/P&gt;
&lt;P&gt;Brian Harry is also reaching out &lt;A href="http://blogs.msdn.com/bharry/" mce_href="http://blogs.msdn.com/bharry/"&gt;http://blogs.msdn.com/bharry/&lt;/A&gt;&amp;nbsp;and I know all the other executive bloggers have their ears on -- and they'll get help.&amp;nbsp; Connect bugs are the best of all but don't be shy, we'll take the feedback however we can get it.&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9914306" width="1" height="1"&gt;</content><author><name>ricom</name><uri>http://blogs.msdn.com/ricom/ProfileUrlRedirect.ashx</uri></author><category term="visual studio" scheme="http://blogs.msdn.com/b/ricom/archive/tags/visual+studio/" /></entry><entry><title>Inside Visual Studio Beta 2 - Performance and Reliability</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/ricom/archive/2009/10/20/inside-visual-studio-beta-2-performance-and-reliability.aspx" /><id>http://blogs.msdn.com/b/ricom/archive/2009/10/20/inside-visual-studio-beta-2-performance-and-reliability.aspx</id><published>2009-10-20T19:13:00Z</published><updated>2009-10-20T19:13:00Z</updated><content type="html">&lt;P&gt;After my keynote speech yesterday at&amp;nbsp;the &lt;A href="http://blogs.msdn.com/ricom/archive/2009/09.aspx" mce_href="http://blogs.msdn.com/ricom/archive/2009/09.aspx"&gt;Development Tools Ecosystem Summit&lt;/A&gt;&amp;nbsp;Charles Torre caught up with me and we made this video.&amp;nbsp; Hot off the presses: &lt;A id=ctl00_MainPlaceHolder_Starter_TitleLink href="http://channel9.msdn.com/posts/Charles/Rico-Mariani-Inside-Visual-Studio-Beta-2-Performance-and-Reliability/"&gt;Rico Mariani: Inside Visual Studio Beta 2 - Performance and Reliability&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;It's super-exciting :)&lt;/P&gt;
&lt;P&gt;If you missed the keynote you can get virtually all the content by watching this video and reading the last entry in my &lt;A href="http://blogs.msdn.com/ricom/archive/tags/History+of+Visual+Studio/default.aspx" mce_href="http://blogs.msdn.com/ricom/archive/tags/History+of+Visual+Studio/default.aspx"&gt;&lt;SPAN style="COLOR: #777777; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri"&gt;&lt;FONT size=3 face=Calibri&gt;History of Visual Studio&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/A&gt; series &lt;A href="http://blogs.msdn.com/ricom/archive/2009/10/19/my-history-of-visual-studio-part-10-final.aspx" mce_href="http://blogs.msdn.com/ricom/archive/2009/10/19/my-history-of-visual-studio-part-10-final.aspx"&gt;My History of Visual Studio (Part 10, final)&lt;/A&gt;.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9910135" width="1" height="1"&gt;</content><author><name>ricom</name><uri>http://blogs.msdn.com/ricom/ProfileUrlRedirect.ashx</uri></author><category term="visual studio" scheme="http://blogs.msdn.com/b/ricom/archive/tags/visual+studio/" /></entry><entry><title>My History of Visual Studio (Part 10, final)</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/ricom/archive/2009/10/19/my-history-of-visual-studio-part-10-final.aspx" /><id>http://blogs.msdn.com/b/ricom/archive/2009/10/19/my-history-of-visual-studio-part-10-final.aspx</id><published>2009-10-19T21:00:00Z</published><updated>2009-10-19T21:00:00Z</updated><content type="html">&lt;p&gt;[All the other Parts: &lt;a href="http://blogs.msdn.com/ricom/archive/tags/History+of+Visual+Studio/default.aspx" mce_href="http://blogs.msdn.com/ricom/archive/tags/History+of+Visual+Studio/default.aspx"&gt;History of Visual Studio&lt;/a&gt;]&amp;nbsp;&lt;/p&gt;
&lt;p&gt;[Visit the &lt;a href="http://go.microsoft.com/fwlink/?LinkID=151797" mce_href="http://go.microsoft.com/fwlink/?LinkID=151797"&gt;Microsoft Visual Studio 2010 and .NET Framework 4 Beta&lt;/a&gt; web site for the latest info]&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Visual Studio 2008 Winds Down, Visual Studio 2010 Begins&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Just as things were starting to wind down on VS2008, I got a new assignment.&amp;nbsp; I was going to be &lt;a href="http://blogs.msdn.com/ricom/archive/2007/07/12/news-about-me.aspx" mce_href="http://blogs.msdn.com/ricom/archive/2007/07/12/news-about-me.aspx"&gt;Chief Architect of Visual Studio&lt;/a&gt;.&amp;nbsp; Wow.&amp;nbsp; So here this series takes a bit of a turn because &amp;ldquo;my&amp;rdquo; history is quite a bit different at this point &amp;ndash; I actually stopped working on the current product at all, and much as I would have liked to write about what I was doing back then, you can imagine there wasn&amp;rsquo;t a whole lot of enthusiasm about starting blog discussions on what we should do in &amp;ldquo;Dev10&amp;rdquo; (the term &amp;ldquo;Hawaii&amp;rdquo; never stuck and was soon abandoned) while we were trying to launch VS2008.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Remodeling&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;From a technical perspective, the idea of VS2010 was to begin a remodeling process that would span several versions.&amp;nbsp; Making key investments that would help long-standing problems and at the same time offer some immediately compelling features as well.&amp;nbsp; I gave a lot of thought to what enabling steps we would have to take to make our experience be something great in say three versions.&amp;nbsp; It was hard to see exactly what that future might be, so I tried not to think about specific features at all. &amp;nbsp;I had seen all sorts of &amp;ldquo;flashware&amp;rdquo; concepts for things we might do and I tried to think about what key problems we would have to solve to implement things of that nature.&amp;nbsp; Using all that, and what I already knew, I came up with a list of fairly low-level considerations for a &amp;ldquo;VS of the Future&amp;rdquo; that I thought we should work on, and why.&lt;/p&gt;
&lt;p&gt;I think the actual document I created is pretty dry, it&amp;rsquo;s full of observations about the size of processor caches, the number of cores, the memory wall, the locality of our data structures, blah, blah, blah.&amp;nbsp; It goes on like this for pages, but I think I can summarize it into a couple of major themes.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Concurrency&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;The first major theme is concurrency, and the need to increase our ability to use it successfully.&amp;nbsp; You might think that with all of those threads Visual Studio spawns that there is a great deal of parallelism but, for the most part, it&amp;rsquo;s only superficial (there are exceptions), what happens more often than not is that those threads run something like&amp;nbsp; relay race with only one thread having the baton at any given moment.&amp;nbsp;&amp;nbsp; One key reason for this is that due to the single-threaded history of our code-base, and indeed many Windows applications, a lot of the objects are tied to the &lt;a href="http://en.wikipedia.org/wiki/Component_Object_Model#Threading_in_COM" mce_href="http://en.wikipedia.org/wiki/Component_Object_Model#Threading_in_COM"&gt;STA&lt;/a&gt; that is the main thread.&lt;/p&gt;
&lt;p&gt;To create opportunities for concurrency you have to start to disentangle the important data structures from the STA and give them better access models that are friendly to concurrency. A great example of this is the new editor in VS2010.&amp;nbsp; It allows you to access editor buffers via immutable micro-snapshots.&amp;nbsp; Previously, if you wanted to do a something like say background analysis on a live text buffer, you had to do crazy things like copying the entire editor buffer on every keystroke.&amp;nbsp; Concepts familiar to database programmers, like &lt;a href="http://en.wikipedia.org/wiki/Isolation_(database_systems)" mce_href="http://en.wikipedia.org/wiki/Isolation_(database_systems)"&gt;isolation&lt;/a&gt;, need to be present in the key structures of any concurrent sytem.&lt;/p&gt;
&lt;p&gt;The STA concerns are a bit like a plague, they can cause a massive &amp;ldquo;entanglement&amp;rdquo; of data processing and presentation.&amp;nbsp; Transitions into or between STAs can result in unexpected message pumping, leading to bizarre &lt;a href="http://en.wikipedia.org/wiki/Reentrant_(subroutine)" mce_href="http://en.wikipedia.org/wiki/Reentrant_(subroutine)"&gt;re-entrancies&lt;/a&gt; which in turn result in astonishing bugs that are very hard to find and fix.&lt;/p&gt;
&lt;p&gt;Additional entanglements occur between processes trying to create parent/child relationships between their windows where the single pump effectively fuses together certain STAs &amp;ndash; a necessary step given typical application assumptions but a total bug nightmare and a parallelism disabler.&lt;/p&gt;
&lt;p&gt;Ultimately the most important thing is to make it as easy as possible to move work off of the UI thread.&amp;nbsp; I think it&amp;rsquo;s vitally important that there is a single thread responsible for the UI &amp;ndash; it&amp;rsquo;s the sanest way to preserve the order of operations the user initiated &amp;ndash; the &lt;a href="http://en.wikipedia.org/wiki/Causality" mce_href="http://en.wikipedia.org/wiki/Causality"&gt;causality&lt;/a&gt; from their perspective if you will &amp;ndash; but as their requests become non-trivial you need the flexibility to do them asynchronously.&lt;/p&gt;
&lt;p&gt;There are two major kinds of background activity that come up in an IDE; it is easiest to illustrate these two needs by example:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Search for &amp;ldquo;foo&amp;rdquo;
&lt;ul&gt;
&lt;li&gt;This can be done in a totally asynchronous fashion with different &amp;ldquo;threads&amp;rdquo; proceeding in parallel against different editor buffers or other searchable contexts.&amp;nbsp; All the foos light up as they are discovered for instance.&lt;/li&gt;
&lt;li&gt;Foos that are not visible need not be processed, so this sort of parallelism has the option to be &amp;ldquo;lazy&amp;rdquo;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Rename &amp;ldquo;foo&amp;rdquo; to &amp;ldquo;bar&amp;rdquo;
&lt;ul&gt;
&lt;li&gt;We can still do this asynchronously but now there is an expectation that we will eventually do it all and of course we must do all the foos not just the visible ones&lt;/li&gt;
&lt;li&gt;Generally this requires progress, and a transaction&lt;/li&gt;
&lt;li&gt;It can fail, or be cancelled, these are normal things&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Both of these represent two cases where we can use a &amp;ldquo;coarse&amp;rdquo; parallelism model (e.g. one file at a time, independently).&amp;nbsp; Of course we also would like to do fine-grained parallelism in places and in fact searching could be amenable to this as well (e.g. search odd lines with one thread even lines with another).&amp;nbsp; Fine-grained parallelism has the opportunity to keep data locality good because you can access the data in one stream rather than access disparate data streams all at once, at the expense of more complex scheduling.&amp;nbsp; Locality is good for performance, more threads are good, sounds good but you need some fundamentals to make any of this happen:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Limited memory usage in the face of many threads running&lt;/li&gt;
&lt;li&gt;Ability to safely access the data in slices that are durable and limited in span&lt;/li&gt;
&lt;li&gt;Isolation from changes that happen during the operations&lt;/li&gt;
&lt;li&gt;No STA requirements in the data access and a asynchronous way to deliver updates to the UI&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Putting the text editor on a plan that can satisfy these needs is itself a big step forward&lt;a title="_Toc177300759" name="_Toc177300759"&gt;&lt;/a&gt; but on a long term basis it would be nice to do many things on this plan.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New UI Model&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Again, I went on at great length about this in my original memo but I&amp;rsquo;ll treat this topic even more briefly than concurrency.&amp;nbsp; The long and the short of it is that your average developer&amp;rsquo;s machine has the equivalent of a few 1990s supercomputers for a &lt;a href="http://en.wikipedia.org/wiki/GPU" mce_href="http://en.wikipedia.org/wiki/GPU"&gt;GPU&lt;/a&gt; (we could haggle over how many) and it&amp;rsquo;s important to be able to get good mileage out of that unit.&amp;nbsp; It&amp;rsquo;s hard to imagine achieving those kinds of successes at reasonable cost using the good old &lt;a href="http://msdn.microsoft.com/en-us/library/dd145213(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/dd145213(VS.85).aspx"&gt;WM_PAINT&lt;/a&gt; + &lt;a href="http://en.wikipedia.org/wiki/Graphics_Device_Interface" mce_href="http://en.wikipedia.org/wiki/Graphics_Device_Interface"&gt;GDI&lt;/a&gt; model &amp;ndash; a high quality retained mode graphics system is basically a must.&lt;/p&gt;
&lt;p&gt;In addition to a making it easier to use the GPU, there is also a tremendous desire to do good separation between the UI and the data elements of your design.&amp;nbsp; Not just because this is architecturally sensible and clean but, as I discussed in the previous section, because to do otherwise significantly hinders your ability to achieve a good degree of parallelism.&amp;nbsp; The retained mode graphics model actively encourages badly needed separation and you all know I love the &lt;a href="http://blogs.msdn.com/brada/archive/2003/10/02/50420.aspx" mce_href="http://blogs.msdn.com/brada/archive/2003/10/02/50420.aspx"&gt;Pit of Success&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Ultimately that leads to the choice of &lt;a href="http://en.wikipedia.org/wiki/Windows_Presentation_Foundation" mce_href="http://en.wikipedia.org/wiki/Windows_Presentation_Foundation"&gt;WPF&lt;/a&gt; for presentation in Visual Studio because the long term choices are to either use that or roll our own.&amp;nbsp; However WPF and &lt;a href="http://en.wikipedia.org/wiki/Silverlight" mce_href="http://en.wikipedia.org/wiki/Silverlight"&gt;Silverlight&lt;/a&gt; evolve in future frameworks, and you&amp;rsquo;d have to be crazy to think they won&amp;rsquo;t, we&amp;rsquo;re better off using WPF notions than relying on the past, or worse, on something of our own making.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;What came of all this?&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve deliberately avoided going into feature discussions so far, just as I did in my original memo, but ultimately we had to choose particular product areas where we would take these notions and invest in moving them into a good direction.&amp;nbsp; That&amp;rsquo;s the point of the &amp;ldquo;remodel&amp;rdquo; after all.&lt;/p&gt;
&lt;p&gt;These are some of the major initiatives that got an investment; they had impact throughout the entire product.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Multi-targeting&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;A new framework, and in particular a new CLR, essentially mandated that we do this work.&amp;nbsp; We had been able to do this more cheaply in previous releases because all the target frameworks shared a CLR (the CLR had been on v2.0 even though the framework moved on to 3.0 and 3.5).&amp;nbsp; This base level of compatibility allowed a simpler &amp;ldquo;onion-skin&amp;rdquo; kind of model to deliver an effective solution in Orcas &amp;ndash; that wasn&amp;rsquo;t going to work in Dev10.&amp;nbsp; In Dev10 we had to be able to target CLR 2.0 and CLR 4.0 and we had to do it in such a way that any given solution might use the related frameworks in any combination.&amp;nbsp; We certainly couldn&amp;rsquo;t assume that the mscorlib that the IDE had loaded was the one that the user wanted to target.&lt;/p&gt;
&lt;p&gt;Then there&amp;rsquo;s the matter of tools.&amp;nbsp; There are different compilers for different frameworks and we can&amp;rsquo;t assume that, for instance, the C# compiler for version 4.0 is the right tool for the job when building a project designed to run on version 3.5. And even if we were super careful with the compilers, what about all the other tools that create outputs, like say resources? Those assets might be in a format that is serialized with the expectation that a particular framework will load it.&amp;nbsp; So no one tool could do the job.&lt;/p&gt;
&lt;p&gt;And let&amp;rsquo;s not forget the native tools, they have all these problems too, though I&amp;rsquo;ve been using managed examples, you can search and replace the runtime names in my discussion with native tools and libraries and you get basically all the same phenomena.&lt;/p&gt;
&lt;p&gt;So in VS2010, based on the project target, we have to select the right libraries and tools to create all your outputs and we have to be able to vary these on a project by project basis.&amp;nbsp; That sounds good.&lt;/p&gt;
&lt;p&gt;That&amp;rsquo;s just the start.&lt;/p&gt;
&lt;p&gt;The build chain is in some ways the least of our problems, what about all those designers?&amp;nbsp; What about Intellisense?&amp;nbsp; As you change focus from from file to file, depending on the framework you&amp;rsquo;re targeting in that file we need to show you Intellisense for just the methods you can actually use in that context.&amp;nbsp; Likewise designers should include only choices that are reasonable for the current target, so for instance, the items in the &lt;a href="http://en.wikipedia.org/wiki/Winforms" mce_href="http://en.wikipedia.org/wiki/Winforms"&gt;Winforms&lt;/a&gt; designer toolbox should not include controls that are available in the version of the framework the IDE happens to be using, but rather the ones that are available on the desired target, and of course those are not likely to be the same.&lt;/p&gt;
&lt;p&gt;Add to this mix the desire to target platform subsets like the &amp;ldquo;client profile&amp;rdquo; of framework 4.0 and you&amp;rsquo;ve got quite challenge on your hands.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I remember a very compelling breakdown that the teams used to explain the levels of success to management (and me)&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;&lt;b&gt;Good:&amp;nbsp; &lt;/b&gt;Designers and Intellisense prevent you from making mistakes; you see only things that you can really use for your target.&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;&lt;b&gt;Not Good:&lt;/b&gt; Designers didn&amp;rsquo;t warn you, but at least you got a compile time error that was helpful and can be corrected.&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;&lt;b&gt;Bad:&lt;/b&gt; There was no compile time error but when you ran the code you could readily see that it had some target specific aspect that shouldn&amp;rsquo;t be there and you could correct the code to avoid the problem.&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;&lt;b&gt;Ugly:&lt;/b&gt; As above, but there is no reasonable diagnostic information and/or no reasonable way to fix it.&lt;/p&gt;
&lt;p&gt;Obviously we want all aspects to be &amp;ldquo;Good&amp;rdquo; and if that can&amp;rsquo;t be achieved then as few as possible cases in each successively lower category.&amp;nbsp; I think you&amp;rsquo;ll find that as of Beta 2 we&amp;rsquo;ve been very successful.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New Editor&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Without going into a full discussion of the problems with the &amp;ldquo;old&amp;rdquo; editor it is worth mentioning these basic facts:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The old system was blocking innovation because of limitations in how it does the drawing &amp;ndash; adornments are painful to add&lt;/li&gt;
&lt;li&gt;It was &amp;ldquo;tricky&amp;rdquo; to use in non-trivial cases, often requiring extreme interventions such as wholesale copying of buffers to achieve stable state, the locking mechanism is prone to mistakes&lt;/li&gt;
&lt;li&gt;When combined with its undo-manager it sometimes (always?) highly wasteful in terms of memory&lt;/li&gt;
&lt;li&gt;It has assorted algorithms that do not scale well, generally those to do with region tracking &amp;ndash; increasingly critical to editor consumers&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Many customer performance complaints boil down to lack of scalability in the current editor structure. These issues in turn boil down to non-linear memory usage, and non-linear algorithms, where sub-linear choices are possible, and necessary, to create the proper experience.&amp;nbsp; We get real scalability complaints from customers on an ongoing basis and these problems can&amp;rsquo;t be solved by &amp;ldquo;tuning.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;To address these problems we had already built a new editor platform, including visualization and text management services.&amp;nbsp; The design had proven scalability and extensibility and had already shipped (in &lt;a href="http://en.wikipedia.org/wiki/Expression_Blend" mce_href="http://en.wikipedia.org/wiki/Expression_Blend"&gt;Blend&lt;/a&gt;).&amp;nbsp; It was a very real technology.&amp;nbsp; However, there was a great deal of code in Visual Studio that depended on old editor behaviors.&lt;/p&gt;
&lt;p&gt;To simplify adoption of the new editor we created &amp;ldquo;shim&amp;rdquo; services that supported the most popular of the old interfaces allowing existing clients to continue to use those interfaces.&amp;nbsp; Since most editor consumers actually use only a subset of the whole API we were able to substantially mitigate the cost of conversion across Visual Studio &amp;ndash; shims weren&amp;rsquo;t a universal solution, but they helped.&lt;/p&gt;
&lt;p&gt;Now I say that like it was some easy thing but wow it&amp;rsquo;s a ton of work even at the &amp;ldquo;reduced&amp;rdquo; cost.&amp;nbsp; And the number of shims seemed to keep growing, and growing, and&amp;hellip; it took a while to get this under control.&lt;/p&gt;
&lt;p&gt;There were other problems. The new editor wasn&amp;rsquo;t identical to the old, despite being more functional overall it was missing some things &amp;ndash; like column select &amp;ndash; that would need to be added (it&amp;rsquo;s in Beta 2). Then there are the complicated editor interactions in cases like those presented by the &lt;a href="http://msdn.microsoft.com/en-us/library/ms973868.aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms973868.aspx"&gt;Web Forms&lt;/a&gt; designer &amp;ndash; the presence of markup intermixed with a language (like VB or C#) makes Intellisense very tricky.&amp;nbsp; The language service needs to see the file without the markup to provide coloring and Intellisense but of course the user edits the composite file. Getting this to work on the new editor was quite a trick.&lt;/p&gt;
&lt;p&gt;Having gone through all this I think I can say that the new editor has a very bright future; it has unprecedented extensibility &amp;ndash; everything from text replacement, to object insertion, to &lt;a href="http://en.wikipedia.org/wiki/HUD_(video_gaming)" mce_href="http://en.wikipedia.org/wiki/HUD_(video_gaming)"&gt;HUD&lt;/a&gt;&amp;ndash;like overlays.&amp;nbsp; In this version we&amp;rsquo;ve barely begun to tap its capabilities.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New Shell&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;It would be a mistake to think of the new shell as just a redo of the old in WPF, it&amp;rsquo;s quite a lot more than that. &amp;nbsp;There is a whole new toolbar system, a whole new menu system, both based on WPF. The docking controls, easily taken for granted, those are all new.&amp;nbsp; There are the bits that allow document windows to completely float for better multi-monitor support.&amp;nbsp; There are all the decorative bits, the window tabs, the output window tabs.&amp;nbsp; It&amp;rsquo;s starting to add up but these things are only one aspect of the Shell, its UI.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Behind the scenes, there to enable pieces like the new editor that I discussed above, and the project system that will be next, are the &lt;a href="http://msdn.microsoft.com/en-us/library/bb685612.aspx" mce_href="http://msdn.microsoft.com/en-us/library/bb685612.aspx"&gt;Shell Services&lt;/a&gt;.&amp;nbsp; You might see screenshots of the new &lt;a href="http://blogs.msdn.com/pedrosilva/archive/2009/04/02/introducing-vs-extension-manager.aspx" mce_href="http://blogs.msdn.com/pedrosilva/archive/2009/04/02/introducing-vs-extension-manager.aspx"&gt;Extension Manager&lt;/a&gt; and the &lt;a href="http://visualstudiogallery.msdn.microsoft.com/en-us/" mce_href="http://visualstudiogallery.msdn.microsoft.com/en-us/"&gt;Visual Studio Gallery&lt;/a&gt;, they are in some ways the face of much of the underlying work:&amp;nbsp; a new deployment model for extensions centered around the &lt;a href="http://visualstudiogallery.msdn.microsoft.com/en-us/529a374e-f2ae-44a0-802e-b889a2ce768c" mce_href="http://visualstudiogallery.msdn.microsoft.com/en-us/529a374e-f2ae-44a0-802e-b889a2ce768c"&gt;VSIX&lt;/a&gt; packaging format and the &lt;a href="http://www.codeplex.com/MEF" mce_href="http://www.codeplex.com/MEF"&gt;MEF&lt;/a&gt; extension model.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;But those dialogs really are &lt;i style="mso-bidi-font-style: normal;"&gt;just&lt;/i&gt; the face, to make the systems work there are many invisible things, like the MEF catalog and services that manage extension state.&amp;nbsp; In fact, if you were to visit the Shell Services link I provided above, you could go down that entire list and you would find very few of the major systems that were not affected in this rewrite.&amp;nbsp; From the Start Page, to Intellisense, most services have had significant work.&amp;nbsp; MEF itself lays out a roadmap for future levels of extensibility in the product, simultaneously more comprehensive, easier to use, and in more areas.&lt;/p&gt;
&lt;p&gt;That last notion is perhaps the most important one, I&amp;rsquo;ve said this many times in various speeches but it bears repeating: It&amp;rsquo;s hard to look at Visual Studio, a product that is substantially ALL extensions, and say &amp;ldquo;it needs more extensibility&amp;rdquo; &amp;ndash; but it does.&amp;nbsp; The original Visual Studio shell provided excellent extensibility of the core services &amp;ndash; VS itself is the proof of that &amp;ndash; but what is lacking is general extensibility of the extensions themselves.&amp;nbsp; These extra levels are what we sought to add in Editor and the Common Project System, and hopefully they will pervade the product over time.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;&amp;ldquo;Common&amp;rdquo; Project System&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve alluded to this system several times so far in the document; it&amp;rsquo;s also an important step on a long-term plan.&lt;/p&gt;
&lt;p&gt;Anyone who has created a project type for Visual Studio knows that it can be a serious pain to try to &lt;a href="http://en.wikipedia.org/wiki/Keeping_up_with_the_Joneses" mce_href="http://en.wikipedia.org/wiki/Keeping_up_with_the_Joneses"&gt;keep up with the Joneses&lt;/a&gt;.&amp;nbsp; The flagship languages add new features (&lt;a href="http://en.wikipedia.org/wiki/ClickOnce" mce_href="http://en.wikipedia.org/wiki/ClickOnce"&gt;ClickOnce&lt;/a&gt; is the canonical example) and since there is no central place to put project features, they end up having to be re-implemented in the code for many different project types.&amp;nbsp; The ability to create project &amp;ldquo;flavors&amp;rdquo; (described a little bit &lt;a href="http://msdn.microsoft.com/en-us/library/bb164709(VS.80).aspx" mce_href="http://msdn.microsoft.com/en-us/library/bb164709(VS.80).aspx"&gt;here&lt;/a&gt;) helps alleviate this somewhat but certainly does not provide complete relief.&lt;/p&gt;
&lt;p&gt;So, at the start of the cycle we find ourselves in a situation that is something like this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;We&amp;rsquo;d like to create project system that would provided the needed extensibility so that we could unify many project types&lt;/li&gt;
&lt;li&gt;We think it would be nuts to create this thing and then try to change all the projects to that plan in one release&lt;/li&gt;
&lt;li&gt;We have the C++ project system which needs to move to &lt;a href="http://en.wikipedia.org/wiki/MSBuild" mce_href="http://en.wikipedia.org/wiki/MSBuild"&gt;MSBuild&lt;/a&gt; anyway to be more like the others and gain MSBuild's incremental build&amp;nbsp;and scale benefits&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So the solution seems obvious &amp;ndash; we&amp;rsquo;ll start building &amp;ldquo;CPS&amp;rdquo; and we&amp;rsquo;ll do C++ first, that way we have a test case, we don&amp;rsquo;t have to change the world all at once, and the C++ team will no longer have to be in the business of managing all its own project stuff.&amp;nbsp; The reason that I quoted &amp;ldquo;Common&amp;rdquo; is that, at least for now, it&amp;rsquo;s only the &lt;a href="http://social.msdn.microsoft.com/Forums/en-US/vs2010ctpcpp/thread/b36cc0ca-3281-42cb-aa5b-6f08fff09603" mce_href="http://social.msdn.microsoft.com/Forums/en-US/vs2010ctpcpp/thread/b36cc0ca-3281-42cb-aa5b-6f08fff09603"&gt;C++ project system&lt;/a&gt; &amp;ndash; though it has ambitions to be a lot more.&lt;/p&gt;
&lt;p&gt;How hard can that be?&amp;nbsp; It&amp;rsquo;s only an all new project system with virtually all of its attributes encoded cascaded XML files, general purpose editing UI, with pervasive MEF extension points, and enough scale to handle the largest C++ solutions we have. &amp;nbsp;Why it&amp;rsquo;s triviality itself J&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Other Highlights&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;When I wrote about &amp;ldquo;Dolphin&amp;rdquo; I gave a litany of changes, it was an impressive list, but I think I can say with candor that I gave a fairly complete list of the major new pieces of work in that release.&amp;nbsp; I was able to do that because the team was a lot smaller and the whole release could fit inside one person&amp;rsquo;s head.&amp;nbsp; I&amp;rsquo;m not even going to pretend that I can write about everything that&amp;rsquo;s in VS2010 &amp;ndash; So far I&amp;rsquo;ve stayed very close to my own team and the things that were most dear to me &amp;ndash; this is only &amp;ldquo;my&amp;rdquo; history after all, the complete history would require input from thousands.&amp;nbsp; So even though I can&amp;rsquo;t possibly be complete, there are a few of my favorite new things that I want to talk about.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;The New C++ Code Model&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;The &lt;a href="http://blogs.msdn.com/vcblog/archive/2009/10/14/visual-c-code-model-in-visual-studio-2010.aspx" mce_href="http://blogs.msdn.com/vcblog/archive/2009/10/14/visual-c-code-model-in-visual-studio-2010.aspx"&gt;VS2010 C++ Code Model&lt;/a&gt; is essentially a complete redo of the old technology.&amp;nbsp; Now I&amp;rsquo;m a funny guy to be writing about this because probably more than any other one person I&amp;rsquo;m responsible for creation of the &lt;b&gt;&lt;i style="mso-bidi-font-style: normal;"&gt;old&lt;/i&gt;&lt;/b&gt; technology.&amp;nbsp; All those .bsc files, that was my baby, we came up with the current system when we were working on &lt;a href="http://msdn.microsoft.com/en-us/library/aa235446(VS.60).aspx" mce_href="http://msdn.microsoft.com/en-us/library/aa235446(VS.60).aspx"&gt;Minimal Rebuild&lt;/a&gt; (previously discussed) and several of my friends had the joy of maintaining that code in the years after I left the C++ team (thanks, you know who you are, and sorry!).&amp;nbsp; The .ncb code was the &amp;ldquo;no compile browser&amp;rdquo; and the original flavor of that was created by another fellow who I supervised, no name dropping, this was another case of &amp;ldquo;give the new guy this really hard project, I&amp;rsquo;m sure he&amp;rsquo;ll do fine&amp;rdquo;.&amp;nbsp; Gee I find myself apologizing a lot in this history.&lt;/p&gt;
&lt;p&gt;Anyway suffice to say they were fine in say 1993 but I think it&amp;rsquo;s possible to do a lot better in 2009 and nobody is happier to see my old code leave the building than me.&amp;nbsp; The new system offers improvements almost across the board, especially in reliability and performance.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Historical Debugging&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;You know I couldn&amp;rsquo;t do another entry without talking about debugger technology. &lt;a href="http://blogs.msdn.com/ianhu/archive/2009/05/13/historical-debugging-in-visual-studio-team-system-2010.aspx" mce_href="http://blogs.msdn.com/ianhu/archive/2009/05/13/historical-debugging-in-visual-studio-team-system-2010.aspx"&gt;Historical Debugging&lt;/a&gt; is a feature that&amp;rsquo;s been incubating in the minds of debugger people probably for as long as they&amp;rsquo;ve been debugging.&lt;/p&gt;
&lt;p&gt;I was the debugger lead in the early 90s and I used to explain the utility of debuggers and debugging tools in this way:&amp;nbsp; Imagine a program with a bug, it has been running along, everything is fine, everything is going wonderful, the flow of execution arrives at a point we&amp;rsquo;ll call Albuquerque, where it turns right.&amp;nbsp; Now as every &lt;a href="http://en.wikipedia.org/wiki/Bugs_Bunny" mce_href="http://en.wikipedia.org/wiki/Bugs_Bunny"&gt;Bugs Bunny&lt;/a&gt; fan knows, the correct thing to do at Albuquerque is to &lt;a href="http://www.bing.com/search?q=I+shoulda+turned+left+at+albuquerque" mce_href="http://www.bing.com/search?q=I+shoulda+turned+left+at+albuquerque"&gt;turn &lt;i style="mso-bidi-font-style: normal;"&gt;left&lt;/i&gt;&lt;/a&gt;. The program&amp;rsquo;s decision to go right has led it down an incorrect path and sometime later we will observe a problem.&lt;/p&gt;
&lt;p&gt;Now if we&amp;rsquo;re very lucky &amp;ldquo;sometime later&amp;rdquo; will be very soon, like for instance it might be that we just de-referenced a null pointer and we&amp;rsquo;re going to take an exception about 2 nanoseconds after the mistake.&amp;nbsp; That&amp;rsquo;s an easy bug to fix.&amp;nbsp; On the other hand it could be that &amp;ldquo;turning right&amp;rdquo; was more subtle &amp;ndash; maybe we corrupted a data structure in a minor way and it might be days before we can see an observable effect &amp;ndash; that kind of bug is a nightmare.&lt;/p&gt;
&lt;p&gt;Finding &amp;ldquo;Albuquerque&amp;rdquo; is what I call The Fundamental Problem of Debugging.&amp;nbsp; The debugger provides you with tools (e.g. breakpoints) that allow you to stop execution while things were still good and slowly approach the point where things first went wrong.&amp;nbsp; The debugger likewise provides you with tools to examine the state afterwards, hoping to find evidence of what went wrong in the recent past that will help you to see the origin.&amp;nbsp; The callstack window is a great example of looking at the past to try to understand what might have already gone wrong.&lt;/p&gt;
&lt;p&gt;To find the problem, you might start after the failure and try to look back, finding a previously unobserved symptom and moving closer to the original problem or you might start before the failure and try to move forward slowly, hopefully not overshooting the problem by too much.&amp;nbsp; Or you might do a combination of these things.&amp;nbsp; You might add assertions or diagnostic output to help you to discover sooner that things went wrong, and give you a view of the past.&amp;nbsp; It&amp;rsquo;s all about finding Albuquerque.&lt;/p&gt;
&lt;p&gt;Historical debugging directly addresses the Fundamental Problem by giving you the ability to look at a lot more of the past.&amp;nbsp; And it&amp;rsquo;s far superior to the limited ideas we had back in the 90s for accomplishing the result.&amp;nbsp; I know a couple of people who have had this idea in their head for over fifteen years &amp;ndash; it&amp;rsquo;s great to see it out there for programmers to enjoy.&amp;nbsp; I think you&amp;rsquo;ll love it, it&amp;rsquo;s like a drug! J&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Help&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;The Help system was another case where we saw very early on that it should get a remodel.&amp;nbsp; I think the energy around that effort began with a very well written memo from a &lt;a href="http://blogs.msdn.com/aprilr/" mce_href="http://blogs.msdn.com/aprilr/"&gt;friend of mine&lt;/a&gt;.&amp;nbsp; Frankly the sad truth is that it was pretty hard to find people who had anything nice to say about the Help system in late 2008.&amp;nbsp; I think many users had given up and were just using their favorite online search to find what they needed, which, as a doubly tragic statistical truth, was probably not our search.&lt;/p&gt;
&lt;p&gt;The Help team didn&amp;rsquo;t have an architect so I loaned myself out to them and together we made what I think are some pretty cool plans that have borne fruit.&amp;nbsp; The new system is much lighter weight and is standards based.&amp;nbsp; Taking a cue from MS Office the content files are basically &lt;a href="http://en.wikipedia.org/wiki/XHTML" mce_href="http://en.wikipedia.org/wiki/XHTML"&gt;XHTML&lt;/a&gt; in a &lt;a href="http://en.wikipedia.org/wiki/.zip" mce_href="http://en.wikipedia.org/wiki/.zip"&gt;.ZIP file&lt;/a&gt; with a custom extension &lt;a href="http://mariusbancila.ro/blog/2009/05/12/help-3-in-visual-studio-2010/" mce_href="http://mariusbancila.ro/blog/2009/05/12/help-3-in-visual-studio-2010/"&gt;MSHC&lt;/a&gt;.&amp;nbsp; This is an archivist&amp;rsquo;s dream, but it also opens up the Help authoring space tremendously &amp;ndash; with no documentation at all you can now just look at one of the archives and pretty much figure out how to get your content anywhere in the system.&lt;/p&gt;
&lt;p&gt;For offline viewing, the customer help viewer is gone, replaced with a mini localhost web-server that delivers the help to the browser of your choice from the archives.&amp;nbsp; We tried various indexing strategies for full-text and other searches but ultimately settled on a custom indexer that I wrote in a few days (well, to be fair they did a lot of work on it after I finished my parts, but I wrote the core).&amp;nbsp; The indexer is actually very similar in operation to my old &lt;a href="http://msdn.microsoft.com/en-us/library/87x7wc99(VS.80).aspx" mce_href="http://msdn.microsoft.com/en-us/library/87x7wc99(VS.80).aspx"&gt;bscmake&lt;/a&gt; program, the C++ program database generator &amp;ndash; those techniques fit Help content well, and it produces &lt;a href="http://mariusbancila.ro/blog/2009/05/12/help-3-in-visual-studio-2010/" mce_href="http://mariusbancila.ro/blog/2009/05/12/help-3-in-visual-studio-2010/"&gt;MSHI&lt;/a&gt; files.&lt;/p&gt;
&lt;p&gt;Importantly, you don&amp;rsquo;t have to create our index format to publish Help for your topics; the MSHC file has all the information in the XHTML.&amp;nbsp; We ship pre-built MSHI files to save installation time because of the size of our corpus, but you don&amp;rsquo;t have to.&amp;nbsp; Additionally, the MSHI files can actually be merged as much or as little as desired for even more performance.&amp;nbsp; But don&amp;rsquo;t merge MSHI&amp;rsquo;s from different &lt;a href="http://en.wikipedia.org/wiki/Locale" mce_href="http://en.wikipedia.org/wiki/Locale"&gt;locales&lt;/a&gt; because there is no usable universal sort order that looks decent to customers.&lt;/p&gt;
&lt;p&gt;A 3&lt;sup&gt;rd&lt;/sup&gt; party help viewer need not use MSHI at all, you could easily build your own index.&lt;/p&gt;
&lt;p&gt;The content itself is delivered in a much lighter weight format, the big tree control is gone.&amp;nbsp; In fact most of the styling for the pages is itself stored in the content as a topic and it can all be updated like any other content.&amp;nbsp; You can have a lot of help on your system, or just a minimal set of your favorite books, your choice.&lt;/p&gt;
&lt;p&gt;Overall I&amp;rsquo;m very happy with how this effort went. We replaced aging indexing technology with something new and much more precise.&amp;nbsp; We removed the viewer application entirely.&amp;nbsp; We drastically simplified the interface between the IDE and help (basically it&amp;rsquo;s a URL at this point).&amp;nbsp; And it&amp;rsquo;s faster!&lt;/p&gt;
&lt;p&gt;&lt;b&gt;The Benefits of Dogfooding&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s fairly well known that we try to &lt;a href="http://en.wikipedia.org/wiki/Dogfooding" mce_href="http://en.wikipedia.org/wiki/Dogfooding"&gt;dogfood&lt;/a&gt; all our own products.&amp;nbsp; In this particular release I think there were some nice significant benefits from this practice.&amp;nbsp; I&amp;rsquo;ll highlight just a few of the ones that I think are the most important here.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;.NET Framework 4.0&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s hard to imagine not dogfooding this in the release given its importance but there were several unexpected benefits for customers.&amp;nbsp; First, the general character of the release was profoundly affected by Visual Studio&amp;rsquo;s early adoption, and our need to create designer assets for many different framework versions.&amp;nbsp; The effects were felt in everything from binding policy to metadata format.&amp;nbsp; As an architect I was very pleased by these results because in many cases we were able to find and prevent problems on the whiteboard &amp;ndash; where corrections are a lot a cheaper.&lt;/p&gt;
&lt;p&gt;A secondary benefit came about because Visual Studio 2010 had to implement so many existing COM interfaces in managed code &amp;ndash; resulting in a large number of &lt;a href="http://msdn.microsoft.com/en-us/library/f07c8z1c.aspx" mce_href="http://msdn.microsoft.com/en-us/library/f07c8z1c.aspx"&gt;COM Callable Wrapper&lt;/a&gt; (CCW) objects.&amp;nbsp; Likewise much new managed code needed to call existing interfaces that were not being converted, hence significant use of &lt;a href="http://msdn.microsoft.com/en-us/library/8bwh56xe.aspx" mce_href="http://msdn.microsoft.com/en-us/library/8bwh56xe.aspx"&gt;Runtime Callable Wrapper&lt;/a&gt;&amp;nbsp; (RCW) objects.&amp;nbsp; That&amp;rsquo;s all well and good, these technologies had existed for years, however, fairly innocuous seeming choices, like &amp;ldquo;when should RCW&amp;rsquo;s be cleaned up&amp;rdquo; were having profound consequences.&amp;nbsp; The additional CLR cleanup code present in past releases introduced unexpected reentrancy that was not present in the strictly native implementation.&amp;nbsp; Importantly Visual Studio gave us fairly easy and important test cases to work with and ultimately resulted in significant improvements in COM interoperability &amp;ndash; these kinds of experiences make the Framework better for everyone.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Windows Presentation Foundation&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;The WPF team had many headaches to deal with thanks to having VS for a customer but I&amp;rsquo;d like to think WPF also got more than a few benefits.&amp;nbsp; Some of the corrections we asked for were fairly minor &amp;ndash; like the toolbar panel&amp;rsquo;s layout code which was fairly weak, and we have a lot of toolbars.&amp;nbsp; But in other cases there were significant weakness.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;d say that if there was a theme to our WPF problems it was this:&amp;nbsp; that the complexity of Visual Studio&amp;rsquo;s use of hybrid traditional Win32 and WPF elements was a new challenge.&amp;nbsp; But ultimately this resulted in a lot of goodness.&amp;nbsp; It&amp;rsquo;s possible to do good focus transitions now between WPF elements and Win32 elements, something that would make a person&amp;rsquo;s head hurt.&amp;nbsp; And, perhaps even more importantly, different combinations of hosting WPF in Win32 UI and Win32 UI in WPF were resulting in extra drawing delays.&amp;nbsp; These paths were exercised by the many window combinations present in Visual Studio and the abundance of big display transitions (like switching to debug mode and back).&amp;nbsp; Generally speaking the hosting services got a lot of exercise and were significantly improved as a consequence.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ll talk a little bit more about WPF below specifically as it relates to Beta 2.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Team Foundation Server&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Of all the technologies that we beat on, I think &lt;a href="http://en.wikipedia.org/wiki/Team_Foundation_Server" mce_href="http://en.wikipedia.org/wiki/Team_Foundation_Server"&gt;TFS&lt;/a&gt; probably got the beating worse than any other system.&amp;nbsp; For sheer volume of users, size and number of shelf-sets, number of branches, merges, automated builds, reports, to say nothing of bugs, issue tracking, and basically every other TFS feature our entire division put a level of load on our TFS systems that makes me think that anyone with any load that is even remotely normal is going to have no trouble at all.&amp;nbsp; Sometimes it was painful for us, like dogfooding is (and is supposed to be) but it&amp;rsquo;s going to be that much better for you.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;From Beta 1 to Beta 2&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve saved the best news for the last section of the last installment.&amp;nbsp; Beta 1 of VS2010 represented some really great progress towards our goals but there were a lot of issues, I&amp;rsquo;m happy to report that we&amp;rsquo;ve been hard at work on the most serious ones and I think we&amp;rsquo;ve got great results for you.&amp;nbsp; I&amp;rsquo;ve listed just a few of the improvements that I think are most important below:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Beta 1 got many complaints due to &amp;ldquo;fuzzy text&amp;rdquo;, in response to this WPF adopted &lt;a href="http://msdn.microsoft.com/en-us/library/dd368038(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/dd368038(VS.85).aspx"&gt;Direct Write&lt;/a&gt; to give a much better overall experience.&amp;nbsp; Those changes accrue to everyone (and yes you&amp;rsquo;ll get lovely text in VS!)&lt;/li&gt;
&lt;li&gt;Performance in Remote Desktop situations is much improved&lt;/li&gt;
&lt;li&gt;Startup time is significantly reduced in virtually all cases&lt;/li&gt;
&lt;li&gt;Raw typing speed is vastly improved, I know that for instance, C# raw typing speed has never been faster&lt;/li&gt;
&lt;li&gt;The new editor includes column select, as well as dozens of other underlying improvements that help region management, outlining and so forth&lt;/li&gt;
&lt;li&gt;Debugger performance, with and without historical debugging, is much improved, stepping is quite snappy&lt;/li&gt;
&lt;li&gt;The Visual Basic project system can now emit an executable while it is compiling a different one, those should yield the best build times ever for VB solutions&lt;/li&gt;
&lt;li&gt;Assorted shell changes in important panels, in data caching, in MEF catalog construction, and in style application will help virtual all cases but notably transitions between modes&lt;/li&gt;
&lt;li&gt;The new offline Help system is ready to you to use&lt;/li&gt;
&lt;li&gt;Find in Files uses a parallel search algorithm, and last, but not least&amp;hellip;&lt;/li&gt;
&lt;li&gt;The hated Add References dialog begins on a sensible tab and populates the full list of references asynchronously should you ask for them&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There are so many improvements I can&amp;rsquo;t possibly list them all. I lost count of the number of performance issues we addressed, there were probably over 100 performance analysis reports counting only my efforts on the most critical scenarios and I was hardly alone in this!&lt;/p&gt;
&lt;p&gt;Generally, looking at the full battery of our performance tests we find that VS2010 outperforms VS2008 in the majority of cases, and, if you weigh the scenarios by importance, VS2010 looks even better than that.&amp;nbsp; Our remaining performance battles are around reducing overall memory consumption, and I&amp;rsquo;m sure that will continue to be a focus area between now and the final release as we fight for every byte.&lt;/p&gt;
&lt;p&gt;Internally, folks are very surprised and pleased by how far we have come in this Beta. I hope you are equally pleased.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To everyone that got this far, thanks so much for reading My History of Visual Studio, and I look forward to your feedback on either the Beta or the series.&lt;/p&gt;
&lt;p&gt;[See &lt;a href="http://channel9.msdn.com/shows/VisualStudioDocumentary/The-Visual-Studio-Documentary-Part-One/" mce_href="http://channel9.msdn.com/shows/VisualStudioDocumentary/The-Visual-Studio-Documentary-Part-One/"&gt;The Documentary&lt;/a&gt;&amp;nbsp;on Channel 9!]&lt;/p&gt;
&lt;p&gt;[All the other Parts: &lt;a href="http://blogs.msdn.com/ricom/archive/tags/History+of+Visual+Studio/default.aspx" mce_href="http://blogs.msdn.com/ricom/archive/tags/History+of+Visual+Studio/default.aspx"&gt;History of Visual Studio&lt;/a&gt;]&amp;nbsp;&lt;/p&gt;
&lt;p&gt;[Visit the &lt;a href="http://go.microsoft.com/fwlink/?LinkID=151797" mce_href="http://go.microsoft.com/fwlink/?LinkID=151797"&gt;Microsoft Visual Studio 2010 and .NET Framework 4 Beta&lt;/a&gt; web site for the latest info]&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9909427" width="1" height="1"&gt;</content><author><name>ricom</name><uri>http://blogs.msdn.com/ricom/ProfileUrlRedirect.ashx</uri></author><category term="visual studio" scheme="http://blogs.msdn.com/b/ricom/archive/tags/visual+studio/" /><category term="History of Visual Studio" scheme="http://blogs.msdn.com/b/ricom/archive/tags/History+of+Visual+Studio/" /></entry><entry><title>My History of Visual Studio (Part 9)</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/ricom/archive/2009/10/16/my-history-of-visual-studio-part-9.aspx" /><id>http://blogs.msdn.com/b/ricom/archive/2009/10/16/my-history-of-visual-studio-part-9.aspx</id><published>2009-10-17T00:35:00Z</published><updated>2009-10-17T00:35:00Z</updated><content type="html">&lt;p&gt;[All the other Parts: &lt;a href="http://blogs.msdn.com/ricom/archive/tags/History+of+Visual+Studio/default.aspx" mce_href="http://blogs.msdn.com/ricom/archive/tags/History+of+Visual+Studio/default.aspx"&gt;History of Visual Studio&lt;/a&gt;]&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In the last posting I talked about the &amp;ldquo;Whidbey&amp;rdquo; release, VS2005, but I feel like I left out two really important aspects so I&amp;rsquo;d like to start this part by rewinding a bit for those two topics.&lt;/p&gt;
&lt;p&gt;I had mentioned in &lt;a href="http://blogs.msdn.com/ricom/archive/2009/10/13/my-history-of-visual-studio-part-7.aspx"&gt;Part 7&lt;/a&gt; that some of the UML support in the &amp;ldquo;Everett&amp;rdquo; time-frame was starting to foreshadow the release of &lt;a href="http://en.wikipedia.org/wiki/Visual_Studio_Team_System"&gt;VSTS&lt;/a&gt;.&amp;nbsp; Well, in Whidbey there is no foreshadowing disclaimer necessary &amp;ndash; &lt;a href="http://msdn.microsoft.com/en-us/library/aa302180.aspx"&gt;VSTS arrives&lt;/a&gt; and I think at that point it&amp;rsquo;s clear that Microsoft is going to try to have a real offering in the &lt;a href="http://en.wikipedia.org/wiki/Application_lifecycle_management"&gt;ALM&lt;/a&gt; space.&amp;nbsp; I think it&amp;rsquo;s fair to say that the venerable &lt;a href="http://en.wikipedia.org/wiki/Microsoft_Visual_SourceSafe"&gt;VSS&lt;/a&gt; was not going to be the product to carry us into the 21&lt;sup&gt;st&lt;/sup&gt; century.&lt;/p&gt;
&lt;p&gt;I don&amp;rsquo;t want to understate the difficulty of bringing just &lt;a href="http://en.wikipedia.org/wiki/Team_Foundation_Server"&gt;TFS&lt;/a&gt; to market, and that&amp;rsquo;s only one part of the equation, but even giving those hard-working folks a well-deserved nod, I felt like the first VSTS was just a taste of ALM at this time &amp;ndash; whetting the appetite as it were.&amp;nbsp; But even so, with so many shops wanting to formalize their practices in some way &amp;ndash; even lightweight practices like &lt;a href="http://en.wikipedia.org/wiki/Scrum_(development)"&gt;Scrum&lt;/a&gt; &amp;ndash; this kind of support was welcome relief.&amp;nbsp; I think those years included a much greater level of attention to the &lt;i style="mso-bidi-font-style: normal;"&gt;process&lt;/i&gt; of creating software than at any other time in my experience.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Just 4 years after its initial 2005 release, VSTS is a huge part of what we deliver &amp;ndash; and in 2002 it didn&amp;rsquo;t even exist.&lt;/p&gt;
&lt;p&gt;I started my discussion about the Whidbey release with an observation about how big of an influence Windows Vista was on our tools.&amp;nbsp; I think I should have ended with my single biggest regret about that release because it&amp;rsquo;s highly related. &amp;nbsp;Despite its huge influence, our support for Windows Vista was lousy in the initial release, like really lousy.&amp;nbsp; It wasn&amp;rsquo;t until we delivered &lt;a href="http://msdn.microsoft.com/en-us/vstudio/bb265237.aspx"&gt;SP1&lt;/a&gt; and especially the &lt;a href="http://msdn.microsoft.com/en-us/vstudio/bb332348.aspx"&gt;Vista support for SP1 pack&lt;/a&gt; that we got to a reasonable level of support.&amp;nbsp; I could make a bunch of excuses but they all sound pathetic to me so I&amp;rsquo;ll just stick with &amp;ldquo;It&amp;rsquo;s my #1 regret.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;OK so much for the downer part of the article; let&amp;rsquo;s move on to Visual Studio 2008 &amp;ldquo;Orcas.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;The thing that I most remember about &amp;ldquo;Orcas&amp;rdquo; is &lt;a href="http://beta.channel9.msdn.com/shows/WM_IN/MQ--Milestone-Quality-MQ-also-equals-Carol-Grojean-program-manager-extraordinaire-in-the-develop/"&gt;&amp;ldquo;MQ&amp;rdquo;&lt;/a&gt; &amp;ndash; the Quality Milestone.&amp;nbsp; This is where we spent the equivalent of an entire coding just taking care of nagging issues that otherwise seem to not get handled. I&amp;rsquo;ll name-drop again since I just linked her video, I&amp;rsquo;d have to say it was Carol more than anyone else that was keeping us honest about the &amp;ldquo;debt&amp;rdquo; we had accumulated in our product and popularizing that meme in our division.&amp;nbsp; Debt is a great way to think about trade-offs: every time you make a choice that isn&amp;rsquo;t right in the long term, any short-cut, accumulates some debt.&amp;nbsp; Any bug you choose to defer, that&amp;rsquo;s debt.&amp;nbsp; Some debt you should write-off, that fix just isn&amp;rsquo;t happening, some you should address, but always you should be aware that you&amp;rsquo;ll have to deal with it sooner or later, and it may as well be sooner.&lt;/p&gt;
&lt;p&gt;That mind-set, which was the focus of MQ was pervasive for the whole release, and I think it shows.&amp;nbsp; From a stability and performance perspective VS2008 was universally better than 2005 &amp;ndash; a very hard thing to achieve in any major release with significant additions.&lt;/p&gt;
&lt;p&gt;I think the &amp;ldquo;star&amp;rdquo; of VS2008 was &lt;a href="http://en.wikipedia.org/wiki/Linq"&gt;Linq&lt;/a&gt; &amp;ndash; my favorite flavor was &amp;ldquo;Linq to SQL&amp;rdquo; which &lt;a href="http://blogs.msdn.com/ricom/archive/2007/06/22/dlinq-linq-to-sql-performance-part-1.aspx"&gt;I&amp;rsquo;ve written about&lt;/a&gt; at some length before.&amp;nbsp; Perhaps the most amazing thing about Linq is that its introduction into both C# and VB allowed mainstream programmers to start using &lt;a href="http://en.wikipedia.org/wiki/Functional_programming"&gt;functional concepts&lt;/a&gt; in a natural way, often without even realizing it!&amp;nbsp; But a close second are two other amazing things:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;1)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Linq variants (Linq to XXX) started appearing like crazy &amp;ndash; the notation was incredibly useful&lt;/p&gt;
&lt;p&gt;2)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; You could actually get great performance out of this kind of layer without inflicting craziness on users (see my article again for the Linq to SQL discussion)&lt;/p&gt;
&lt;p&gt;In the same way that the needs of high quality designers drove advances like partial classes (critical for code separation) Linq variants and their needs, drove the &lt;a href="http://en.wikipedia.org/wiki/Type_inference"&gt;type inference&lt;/a&gt;, &lt;a href="http://en.wikipedia.org/wiki/Extension_method" mce_href="http://en.wikipedia.org/wiki/Extension_method"&gt;extension methods&lt;/a&gt;, and &lt;a href="http://en.wikipedia.org/wiki/Abstract_semantic_graph" mce_href="http://en.wikipedia.org/wiki/Abstract_semantic_graph"&gt;expression tree&lt;/a&gt; features, including concise &lt;a href="http://en.wikipedia.org/wiki/Lambda_calculus"&gt;lambda&lt;/a&gt; notation, necessary for its success into the mainstream languages.&amp;nbsp; &amp;nbsp;This brings great collateral benefits because those exact same notions are helpful in so many other scenarios &amp;ndash; I use them pervasively in my WPF code for event handling for instance.&lt;/p&gt;
&lt;p&gt;As usual this all comes at a cost, it&amp;rsquo;s not just language notation: it&amp;rsquo;s also the debugging support, profiling, garbage collection, FXCOP, and so on.&amp;nbsp; After all, just because a method is dynamically generated, has no name, and no &lt;a href="http://en.wikipedia.org/wiki/Program_database"&gt;.pdb&lt;/a&gt; file information, doesn&amp;rsquo;t mean you don&amp;rsquo;t want to analyze it like the others.&amp;nbsp; And of course the ability to generate expression trees in addition to &lt;a href="http://en.wikipedia.org/wiki/Intermediate_language"&gt;IL&lt;/a&gt; represents another significant undertaking for the compilers.&amp;nbsp; All of this is fundamentally necessary for Linq to succeed but it&amp;rsquo;s kind of invisible &amp;ndash; it&amp;rsquo;s the stuff you expect to just work.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Orcas&amp;rdquo; also included the &amp;ldquo;Cider&amp;rdquo; designer for WPF. Remember that during this period there had been several runtime releases including 3.0 and it shipped alongside 3.5 of the framework.&amp;nbsp; Well by the WPF was a first class application target and it needed designer support and the richness of WPF resulted in perhaps one of the most complicated designers ever created. It&amp;rsquo;s doubtful that a successful designer could have been created if not for the lessons from &amp;ldquo;Sparkle&amp;rdquo; aka &lt;a href="http://en.wikipedia.org/wiki/Microsoft_Expression_Blend"&gt;Expression Blend&lt;/a&gt;, and language advances like partial classes to ease things along.&lt;/p&gt;
&lt;p&gt;The abundance of framework subsets led to the need for multi-targeting &amp;ndash; that is the ability of the tool to target any one of several framework versions or to have solutions with projects targeting arbitrary combinations.&amp;nbsp; This was tricky enough in Orcas but at least the frameworks all shared a common core &amp;ndash; simplifying things significantly.&amp;nbsp; That grace would be absent in the follow-on release VS2010.&lt;/p&gt;
&lt;p&gt;Other application models were popping up as well &amp;ndash; &lt;a href="http://wikipedia/wiki/Silverlight"&gt;Silverlight&lt;/a&gt; had made its debut, taking WPF concepts to the web, and Windows Workflow (&lt;a href="http://en.wikipedia.org/wiki/Workflow_Foundation"&gt;WF&lt;/a&gt;) also delivered a release and a designer.&amp;nbsp; If it wasn&amp;rsquo;t already &lt;i style="mso-bidi-font-style: normal;"&gt;de facto&lt;/i&gt; reality, the general theme that &amp;ldquo;every application model needs a suitable design experience&amp;rdquo; was certainly cemented during this period.&lt;/p&gt;
&lt;p&gt;Debugging technology takes itself to new amazing places like &lt;a href="http://en.wikipedia.org/wiki/XSLT"&gt;XSLT&lt;/a&gt; debugging (XSLT makes my head hurt even more than &lt;a href="http://en.wikipedia.org/wiki/APL_(programming_language)"&gt;APL&lt;/a&gt;) and gains the ability to debug into the &lt;a href="http://en.wikipedia.org/wiki/Base_Class_Library"&gt;BCL&lt;/a&gt; and dynamically download the source as needed to do the job.&amp;nbsp;&amp;nbsp; Very slick, but by now you know I&amp;rsquo;m partial to debugging technology J&lt;/p&gt;
&lt;p&gt;And on the native code front, &lt;a href="http://en.wikipedia.org/wiki/Microsoft_Foundation_Classes"&gt;MFC 9&lt;/a&gt; makes its appearance &amp;ndash; adding support for new Vista concepts, and representing the first significant update to MFC in a very long time.&lt;/p&gt;
&lt;p&gt;But for me the biggest memories are just working on performance across the board, from MQ to the finish.&amp;nbsp; In the framework, in the tools, we made big dents in many scenarios and overall, even with lots of new features, Orcas felt snappier than Whidbey which was a great accomplishment.&amp;nbsp; I loved using it!&lt;/p&gt;
&lt;p&gt;I just hit 1200 words so I think it&amp;rsquo;s time to stop, having skipped vast regions and barely mentioned VSTS, I&amp;rsquo;ll pick up again in a bit.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thank you for all the feedback and comments, they&amp;rsquo;re much appreciated.&lt;/p&gt;
&lt;p&gt;[See &lt;a href="http://channel9.msdn.com/shows/VisualStudioDocumentary/The-Visual-Studio-Documentary-Part-One/"&gt;The Documentary&lt;/a&gt;&amp;nbsp;on Channel 9!]&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9908435" width="1" height="1"&gt;</content><author><name>ricom</name><uri>http://blogs.msdn.com/ricom/ProfileUrlRedirect.ashx</uri></author><category term="visual studio" scheme="http://blogs.msdn.com/b/ricom/archive/tags/visual+studio/" /><category term="History of Visual Studio" scheme="http://blogs.msdn.com/b/ricom/archive/tags/History+of+Visual+Studio/" /></entry><entry><title>My History of Visual Studio (Part 8)</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/ricom/archive/2009/10/14/my-history-of-visual-studio-part-8.aspx" /><id>http://blogs.msdn.com/b/ricom/archive/2009/10/14/my-history-of-visual-studio-part-8.aspx</id><published>2009-10-15T02:32:00Z</published><updated>2009-10-15T02:32:00Z</updated><content type="html">&lt;p&gt;[All the other Parts: &lt;a href="http://blogs.msdn.com/ricom/archive/tags/History+of+Visual+Studio/default.aspx" mce_href="http://blogs.msdn.com/ricom/archive/tags/History+of+Visual+Studio/default.aspx"&gt;History of Visual Studio&lt;/a&gt;]&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I can&amp;rsquo;t really talk about what was going on in the IDE without covering what was happening in the runtime because their fates are so intertwined, so even though it&amp;rsquo;s off topic a little bit, allow me to cover some details from Framework 2.0.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Longhorn&amp;rdquo;, which became Windows Vista, was probably the single greatest influence on the Developer Division during the years when .NET Framework 2.0 and Visual Studio 2005 (collectively &amp;ldquo;Whidbey&amp;rdquo;) were being developed.&amp;nbsp; I think I could write several books on those years as a study in being too successful for your own good.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;As I wrote earlier there was a certain mania in managed code adoption during that time and, though ultimately some of those efforts had to be scrapped, many were a positive influence on the tool chain.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Anecdote: It&amp;rsquo;s not really important to the story but just for fun I can&amp;rsquo;t resist telling you about my first day on the job when I joined the CLR performance team.&amp;nbsp; I had been working for the last 7 years in the MSN area, with a great emphasis on server workloads, data architectures, and so forth.&amp;nbsp; So I was a bit surprised when on day one I was told I was going to be working on our client performance problems &amp;ndash; that&amp;rsquo;s a Whisky Tango Foxtrot moment.&amp;nbsp; Pays to be flexible I guess J&lt;/p&gt;
&lt;p&gt;Client workloads were a lot harder on the .NET Framework at that time.&amp;nbsp; We did have an ngen story but it needed a lot of work.&amp;nbsp; Putting as much code as possible into readily shared DLLs is fundamentally necessary to getting reasonable memory usage on the client &amp;ndash; much less of an issue on dedicated servers for instance.&amp;nbsp; Contrariwise, code sharing is even more essential on a Terminal Server with potentially hundreds of users running client applications.&lt;/p&gt;
&lt;p&gt;Sharing also vitally important to flagship applications, like Visual Studio, that are trying to get their code loaded as quickly as possible using technologies like &lt;a href="http://en.wikipedia.org/wiki/Superfetch#SuperFetch"&gt;Superfetch&lt;/a&gt;.&amp;nbsp; It&amp;rsquo;s a pretty simple chain of events, jitted code can&amp;rsquo;t be shared, unshared code uses more memory, use too much memory and you&amp;rsquo;re dead. Sharing is good. We had to do more of it.&amp;nbsp; It was doubly important because major new Framework elements were being developed while this was all going on: &amp;nbsp;things like Windows Presentation Foundation (WPF) and Windows Communication Foundation (WCF) to name a few.&lt;/p&gt;
&lt;p&gt;The Base Class Library (BCL) was gaining support for Generics (starring my favorite Nullable&amp;lt;T&amp;gt;) and XML use was exploding in all parts of the stack.&amp;nbsp; I used to joke that if angle brackets &amp;lt;&amp;gt; had never been invented I would have no performance issues to work on.&amp;nbsp; If only it were true.&lt;/p&gt;
&lt;p&gt;In the universe of technologies requiring tool support we really should add at least two more.&amp;nbsp; There were yet more improvements to ASP.NET, there were compelling 64 bit architectures (x64 and ia64), and, probably most difficult of all the considerations, there was &lt;a href="http://en.wikipedia.org/wiki/Microsoft_SQL_Server#SQL_Server_2005"&gt;SQL Server 2005&lt;/a&gt; &amp;ldquo;Yukon&amp;rdquo; which introduced SQL CLR allowing users to write stored procedures in managed code.&lt;/p&gt;
&lt;p&gt;Again, I could write whole books on what was going on in the runtime components, but I&amp;rsquo;m trying to stay focused on Visual Studio for this series so I think that&amp;rsquo;s probably enough landscape setting, as it is with all those changes it&amp;rsquo;s easy to see why Whidbey took nearly three years.&lt;/p&gt;
&lt;p&gt;For starters, there were whole new project and deployment types needed to support the new ASP.NET with its own, new, developer server; and likewise for the SQL scenarios.&amp;nbsp; And while I&amp;rsquo;m on the topic of project and deployment this is also where &amp;ldquo;&lt;a href="http://en.wikipedia.org/wiki/ClickOnce"&gt;ClickOnce&lt;/a&gt;&amp;rdquo; makes its debut.&lt;/p&gt;
&lt;p&gt;ClickOnce had to permeate our project systems but its introduction also highlighted an inherent weakness:&amp;nbsp; despite the extensibility offered in the project space there was (and indeed is) no one central place ClickOnce deployment could be added so that all project types would benefit.&amp;nbsp; This is a classic example of why ongoing refactoring/remodeling of architecture is so important.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Personal note: my first direct interaction with the Visual Studio team during this time period was working on the performance of the Create New Project dialog &amp;ndash; something which can never quite go fast enough to make us happy.&lt;/p&gt;
&lt;p&gt;Ok so the project system needed work.&amp;nbsp; What else?&amp;nbsp; Well, anytime you add pretty much anything you can expect the debugger to be affected, this was no exception.&amp;nbsp; Generics &amp;ndash; check, needs debugging support, SQL CLR &amp;ndash; check needs debugging support, it was a long list.&amp;nbsp; But there was even more than just that going on: I have written earlier about the challenges of what we call &amp;ldquo;interop debugging&amp;rdquo; (where you debug both managed and unmanaged code at the same time) &amp;ndash; in this release both the debugger and runtime teams put considerable effort into making interop debugging more reliable.&amp;nbsp; That meant taking a very hard look at all the communications logic, the locking model, the safe-stopping points vs. &amp;ldquo;skid&amp;rdquo; points as I called them.&amp;nbsp; It was a huge endeavor, but as a result interop debugging got noticeably better in VS2005.&lt;/p&gt;
&lt;p&gt;All this hard work actually had an unexpected extra bonus.&amp;nbsp; We also introduced a managed code profiler in this timeframe and as it turns out, trying to stop managed code as it runs so that you can walk the stack the way profilers like to do tends to have all the same kinds of problems as trying to stop the code in a debugging context.&amp;nbsp; As a result, much of the hard work that went into getting the debugger working resulted in a more effective profiler solution.&lt;/p&gt;
&lt;p&gt;I should come back to SQL 2005 support &amp;ndash; it isn&amp;rsquo;t enough to just add project and debugging features but &lt;a href="http://en.wikipedia.org/wiki/ADO.NET"&gt;ADO.NET&lt;/a&gt; 2.0 was making its appearance and that requires suitable designers.&amp;nbsp; Visual Studio perhaps earns its name more so than its antecedent &lt;a href="http://en.wikipedia.org/wiki/Visual_Basic"&gt;Visual Basic&lt;/a&gt; because it&amp;rsquo;s Visual in many different ways &amp;ndash; just visual forms no longer suffices.&amp;nbsp; New SQL engine means data designers are a must.&lt;/p&gt;
&lt;p&gt;As if all of that wasn&amp;rsquo;t enough, there were two brand new pieces of technology that appeared during this time as well.&amp;nbsp; These were part of our Office programming story:&amp;nbsp; &lt;a href="http://en.wikipedia.org/wiki/Visual_Studio_Tools_for_Applications"&gt;VSTA&lt;/a&gt; and &lt;a href="http://en.wikipedia.org/wiki/VSTO"&gt;VSTO&lt;/a&gt;.&amp;nbsp; In a few words, VSTA is tooling for &lt;a href="http://en.wikipedia.org/wiki/Independent_software_vendor"&gt;ISV&amp;rsquo;s&lt;/a&gt; to provide scripting features to their users, allowing their users to write managed language programs that automating their product.&amp;nbsp; The primary user is clearly Office but in principle anyone can participate &amp;ndash; you get a complete authoring experience with it.&amp;nbsp; VSTO, in contrast, allows you to write office extensions, intended to be written as native code against a COM API, using managed languages instead.&amp;nbsp; That poor sentence hardly does justice to the difficulty of achieving this result, and I&amp;rsquo;m glossing over the fact that there were other VSTO solutions as far back as 2003 but this is where I remember the spotlight first shining on that technology with any kind of luminosity.&lt;/p&gt;
&lt;p&gt;But, even with all this good work, there was one thing that stands out in my memory as being more important than all the others.&lt;/p&gt;
&lt;p&gt;Edit and Continue was back &amp;ndash;&amp;nbsp;and there was great rejoicing.&lt;/p&gt;
&lt;p&gt;[See &lt;a href="http://channel9.msdn.com/shows/VisualStudioDocumentary/The-Visual-Studio-Documentary-Part-One/" mce_href="http://channel9.msdn.com/shows/VisualStudioDocumentary/The-Visual-Studio-Documentary-Part-One/"&gt;The Documentary&lt;/a&gt;&amp;nbsp;on Channel 9!]&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9907419" width="1" height="1"&gt;</content><author><name>ricom</name><uri>http://blogs.msdn.com/ricom/ProfileUrlRedirect.ashx</uri></author><category term="visual studio" scheme="http://blogs.msdn.com/b/ricom/archive/tags/visual+studio/" /><category term="History of Visual Studio" scheme="http://blogs.msdn.com/b/ricom/archive/tags/History+of+Visual+Studio/" /></entry></feed>