When I did my BCL presentation at Code Camp Oz in April I managed to stuff up a demo that should have worked perfectly.

I was showing off the NetworkChange class that lives in the System.Net.NetworkInformation namespace (more on this in a future post). In my demo I launched a console application, wired up the events to some code that would execute when the events fired. The idea was that I could take my wireless card, insert it into the laptop and I would get some text on the console.

It was a risky demo, because I hadn’t tried it before with this particular set up. When i inserted the card my heart sank – nothing, the console window was empty. Since it was my last demo and I was pretty much close to running over time I was ready to walk off and hang my head in shame – but just before I gave up one of the audience members noticed that the output had been redirected to the “Quick Console” window.

Quick Console is a new feature that has found its way into Visual Studio 2005 (BETA 2) which captures output from applications that is destined for the console and redirects to a window inside Visual Studio itself. It wouldn’t be so bad except that its no longer appears in the actual console window which can be confusing as all hell when thats the behaviour that you are expecting but if you are coming from VS.NET 2003 it simply isn’t.

Since then I’ve been caught a number of times by this little “feature” and have spent minutes wondering why I haven’t been seeing any output. Fortunately you can disable it under Tools | Options | Debugging | General – but personally I would prefer to see the product with the feature disabled or even absent.

One issue I have noticed was performance when compared with traditional console output. Now console output performance isn’t the greatest at the best of time and if you need extra speed trimming the number of UI updates per second (or more) can really make you go faster – but by my calculations the “Quick” Console is about 3.7 times slower than the old-fashioned one.

To test this I wrote a simple program that does ten thousand iterations over some Console.WriteLine(…) code that emits the current iteration number and the number of milliseconds since the program started.

QuickConsoleTestProgram

In the ye’olde console it was able to output that much text in about 2.7 seconds which is pretty slow, so you can see how much doing output this way can slow things down.

ConsoleTimings

Now lets take a look at “Quick” Console. Quick Console took about 10.1 seconds to output the same amount of text, like I said, about 3.7 times slower than the other approach.

QuickConsoleTimings

To be honest I expected it to be much worse than that given the amount of paint work involved – something that the traditional console window would have been heavily optimised to do over the years.

Performance issues aside the Quick Console has other issues which need to be addressed – some are bugs that will probably be fixed by RTM, others are by-design issues (such as a lack of colouring). It will be interesting to see if this feature is scrapped or it can be fixed.

P.S. You can download the code from here.