Showing posts with label Visual Studio. Show all posts
Showing posts with label Visual Studio. Show all posts

Wednesday, May 11, 2011

Add-in Start-up Time in Visual Studio 2010

justcode-fastWhile I was in Dallas last week for a quick DNUG speaking tour, a good question came-up regarding the Telerik tools that extend Visual Studio: Should you expect them to add time to the Visual Studio loading time?

Clearly, different products integrate with Visual Studio in different ways (thus impacting the VS startup process differently), but we have invested focused energy making sure the Telerik tools do not significantly degrade the VS start-up (or runtime) process. As a result, the general answer to the question is that Telerik tools should not add more than a few seconds to VS start-up time.

But I decided a more specific answer was in order.

To more fully answer this question, I did a series of tests with my local copy of Visual Studio 2010 Ultimate to see how much different VS add-ins impacted the overall Visual Studio startup time.

Add-in Time Tests

The goal: understand how different add-ins installed on my machine impact the "baseline" Visual Studio start-up time. Since every computer configuration is going to impact the absolute values of a test like this, the most important thing to compare is the relative difference to the baseline. The baseline in this case is Visual Studio started in Safe Mode (devenv /safemode), which automatically disables any and every VS add-in.

MEASURING THE START-UP TIME
I tried a couple of different approaches for measurement. I wanted to use something precise that could take the measurements for me (like AppTimer), but no automatic solution could reliably determine when exactly Visual Studio was truly "loaded" and ready for action. So, a manual stopwatch was employed with precision dexterity to start the timer and run the devenv process simultaneously. (Multiple tests were conducted, too, to minimize error, of course.)

THE RAW TEST RESULTS
There is not much rhyme or reason to the add-ins that I measured (beyond the Q1 2011 Telerik tools) other than that the plug-ins were already running on my machine. So here are the results (times are rounded since millisecond precision here isn't that meaningful):

VS ADD-INS ENABLED Impact on Baseline Start-up Time
(in seconds)
Baseline (/safemode) -- (for the record, 1.8 sec)
No Plugins (w/o Start Page) +1 (with Start Page, +2)
Only JustMock -- (No measurable impact)
Only JustTrace --
Only JustCode +4
JustCode, JustMock, JustTrace +4
Only OpenAccess +1.5
JC,JM,JT,OA +5
NON-TELERIK ADD-INS  
Only BuildIncrementVersion -- (No measurable impact)
Only VisualGit +1
Only Chirpy --
Only .NET Reflector Pro +1
Only VMWare VMDebugger +10!

Out of curiosity (since I know many of you are), I decided to also test the latest versions of ReSharper and CodeRush/Refactor to see how they comparably impacted VS load time. Same test method. Results:

VS ADD-INS ENABLED Impact on Baseline Start-up Time
(in seconds)
Only ReSharper 5.1 +3.5*
Only CodeRush/Refactor 10.2.8 +3.5*

*These times need explanation. More on that below.

Analyzing the Start-up Test Results

There are few quick takeaways from these basic tests:

  • Many add-ins, including JustMock, JustTrace, Chripy, and BuildIncrementVersion have virtually no impact on the Visual Studio start-up time. As you might expect, though, these add-ins are doing very little to really integrate deeply into the VS IDE.
  • VMWare's VS add-in is a HUGE offender. It added over 10 seconds to raw startup time! I didn't realize this 'til my tests. You can bet this add-in will stay disabled from now on unless I need it!
  • JustCode only adds about 4 seconds to VS start time, which is roughly on par with similar VS productivity plug-ins.

I did observe that ReSharper and CodeRush seem to "lazy load," so while Visual Studio appears to open quickly, it remains unresponsive after opening while these plug-ins run through their loading routines. JustCode, meanwhile, fully loads during VS startup, so as soon as VS opens, it's ready to go. Ultimately, the add-ins all add roughly the same time to the VS start-up, just in different places. You can be sure Telerik will continue to invest heavily in optimizing the JustCode start-up routines so we can continue to set the new standard in Visual Studio productivity tools.

--

At the end of the day, I'm satisfied with these results. I don't launch instances of Visual Studio that often during a day (usually open and leave open), and an additional 4 or 5 seconds seems like a minimal start-up delay for all of the time JustCode, JustMock, and OpenAccess will save during development (especially since JustCode doesn't add crippling, time-sapping "lag" to Visual Studio like some add-ins). We'll keep innovating, though, and find new ways to make our impact event smaller.

In the meantime, if you're not seeing results like this, and your VS is taking a long time to load, look for other non-Telerik add-ins (VMWare?) or try "resetting" your VS by booting once in Safe Mode (this seems to work for me when VS load times get oddly slow over time). Hope this helps!

(And in case you missed it, be sure to check-out the top 10 ways JustCode makes Visual Studio better!)

Thursday, August 12, 2010

Best Practice: Making OpenAccess projects version independent

When working on any project that references external libraries, it’s important to configure your project references in such a way that “isolates” them from changes to your system. This is especially true if you’re working on a team and sharing code via source control. You want anyone to be able to check-out the project, and regardless of the software installed on their machine, be able to build and run the code. You also want to be free to upgrade your Telerik tools without being forced to upgrade all of your projects.

To achieve this version independence in your projects, follow this advice:

At at minimum, make local copies in your project folder of all referenced assemblies, and then have your projects reference the external libraries from this project relative location. In my solutions, I often create a top-level “Lib” or “Binaries” folder and copy my DLLs there.

project-1

I also create a Solution Folder of the same name in my Visual Studio solution and add these referenced assemblies to source control. By doing that, anyone that checks-out the project has all of the referenced assemblies needed to build.

project-2

This advice so far suggests two things:

  1. DON’T reference external assemblies required to build your project from the GAC (except for perhaps Microsoft framework assemblies)
  2. DON’T reference assemblies located in a directory that’s not included with your solution (such as an Program Files install location)

Breaking with either of the above suggestions will create headaches when sharing code with your team and headaches for you as you upgrade and change your system. It’s rare that you’ll want to upgrade all of your projects to a new version of an external library at one time, so free your projects from the whims of tool upgrades and reference local copies.

For most external libraries, like the RadControls for ASP.NET AJAX or Telerik Extensions, this is enough to achieve version independence for project builds. If you use OpenAccess, you may want to take one additional step.

Since OpenAccess “enhances” assemblies as part of the build process, your builds have a dependency on the OpenAccess enhancer (venhance.exe). To ensure that anyone that checks-out your solution can still complete a build without being forced to install OpenAccess, copy the venhance.exe to your local solution folders.

VEnhance can be found in the OpenAccess install directory in the SDK folder.

Copy this to your “Binaries” folder, and then configure your OpenAccess-enabled projects to use the local copy of VEnhance instead of the version in Program Files (the default behavior). That’s done by editing your Project Settings and adding a Post-build event:

  1. Right-click on your project and select “Properties”
  2. Click on the “Build Events” tab
  3. In the “Post-build event” textbox, enter:
    "$(SolutionDir)\Binaries\VEnhance.exe" "-assembly:$(TargetPath)"
    (include the quotes and adjust the path to VEnhance as necessary)
  4. Change the “Run” drop down to “Always” and save your project settings

project-3

Now your solution is completely version independent! You can install newer versions of OpenAccess ORM or any other Telerik tools and your solutions will continue to build against the configured tool versions. When you’re ready to upgrade, you can simply add the newer assemblies to your “Binaries” folder, update your project references, and then start enjoying the latest Telerik features.

Hopefully this basic advice helps you avoid some of the headaches of working with syncing versions of external tools in your solutions. Followed correctly, you’ll never have to worry about breaking existing projects with new installs of Telerik tools.

Tuesday, October 20, 2009

Important releases from Microsoft you may have missed

If you've not been keeping-up with the Microsoft blogs lately, there's a good chance you have missed some pretty cool releases from the folks up in Redmond. Microsoft's been busy releasing betas and CTPs and altogether new tools for developers, and primarily web developers at that. In typical "Microsoft of today" fashion, all of these releases are free, and most of them are available with source code on CodePlex.

What have you missed?
  1. ASP.NET AJAX 4.0 Preview 6 - This is the client-side portion of ASP.NET 4.0 that includes all of the cool news things like client-side templates, client-side data context, and client-side "controls." I've been using and demoing these bits since Preview 4, and I think they are one of my favorite new features in ASP.NET 4.0. You can use them today, though, since all you need are the new JavaScript files. Download on CodePlex.
  2. Microsoft Ajax Minifier - One thing that jQuery has bested Microsoft on for quite some time is library size. jQuery is about 50 KB in its commonly distributed "minified" format, Microsoft Ajax is about 100 KB. The new MAM tool helps close that gap by providing build-time support for minifying any JavaScript file, including Microsoft's Ajax libraries. It's not the first JavaScript minifier, but MSFT is claiming it is one of the most efficient, and the MSBuild scripts don't hurt its likability, either. Download on CodePlex.
  3. ASP.NET MVC 2 Preview 2 - The second update to the ASP.NET MVC v2 project is now available. Preview 2 adds support for things like "Areas," model validation providers, and client-side input validation. Phil does a better job elaborating. If you're an ASP.NET MVC convert (or fan) and you want to get your hands on the latest and greatest, the source is now available (as usual) on CodePlex.
  4. ASP.NET MVC 2 Upgrade Tool - Just squeezing-in before the bell for this blog post, Microsofty Eilon Lipton has also just released a simple tool that helps you upgrade ASP.NET MVC 1 projects to ASP.NET MVC 2. Simple tool, but helpful perhaps for any of you ready to upgrade your MVC 1 sites to a preview framework...Download from his blog.
  5. Ajax Control Toolkit - Do you use the Microsoft Ajax Control Toolkit? If so, you might want to check out their latest release (published earlier this month). It contains a few new controls- SeaDragon control (for Deep Zoom images) and AsyncFileUpload- and a lot of bug fixes. The controls and the source are...everyone now...available for download on CodePlex.
  6. Visual Studio 2010 Beta 2 - Last but certainly not least (and just publicly revealed), Microsoft is finally releasing a broad, public beta of Visual Studio 2010. Beta 2 will be broadly available tomorrow (Wednesday) and it will be your chance to start playing with all of the goodies in .NET 4.0. VS 2010 also sports a pretty nice visual makeover (new logo below), so unlike the upgrade experiences from VS.NET to VS 2008 ("Okay...looks...the same..."), you'll instantly notice that VS 2k10 is a major upgrade. Details on Hanselman's blog. Download from Microsoft.
And I think that's all for October. I could be wrong. Microsoft is updating at a furious pace as we head towards PDC, so it is tough to keep-up. At the very least, this is a great collection of updates any ASP.NET developer should check-out. Grab the updates from Microsoft and try them out this week...because in a few weeks, you'll have lots of new Telerik code to play with!