views:

497

answers:

2

If you create a simple "Hello World" VSTO2SE add-in targeting Microsoft Office Excel 2003, it takes 15 seconds to load on a cold startup. During that time, Excel is completely unresponsive.

The cold-startup time is always poor in Excel 2003. I have seen one test machine where the startup time is instant in Excel 2007, but all my other test machines take 15 seconds to initialize. (test environment - windows xp pro + VSTO2SE runtime + XP SP3)

How can this performance be improved?

Things I've already tried with no success:

  1. Disasble CRL (certificate revoke list) checking - this doesn't seem to help, plus I can't expect users to do this.

  2. Use NGEN to create native assemblies.
    a) It seems that Office 2003 never uses the native assemblies. b) My office 2007 test client that starts fast, does so even with IL assemblies. c) Even if I NGEN my entire depencency tree, there are still VSTO dependencies that may not have native images.

  3. Delay load the add-in - this is the workaround "stock response" i get from Microsoft. The thing is, my add-in is launched from a menu item - how can I delay load the add-in and still get my menus? I could use a VB6 add-in to draw the menus and forward the calls via interop, but then why would I even write a VSTO add-in in the first place?

Edit - Yes, that is the only line on the "connection" event in the add-in. (actually messagebox).. It takes a full 15 seconds before the message box appears. – J Davis

A: 

Have you verified what the actual holdup is? If you put a Debug.Write() statement as the first line in your VSTO addin, does it take 15 seconds to show up in the debug window?

We're working with VSTO and whenever we have holdups, it's usually something other than the actual runtime that's causing the slowdown. We've solved this problem by spinning off background threads to do the slow things while not blocking the main thread, which holds up Excel startup.

ps. We're also not huge fans of the VSTO technology. We're 100% bought into the vision, but the implementation leaves alot to be desired.

Paul Prewett
Yes, that is the only line on the "connection" event in the add-in. (actually messagebox).. It takes a full 15 seconds before the message box appears.
J Davis
+1  A: 

You're going to take a hit on cold start up because it has to load all of the assemblies for the first time.

If warm start up are significantly faster, then the only real options you have are

1) Have a separate program load when windows starts and load all of the assemblies for you r addin in the background.

2)Try to reduce the number of assemblies you are using. Granted, you shouldn't be using much with Hello World.

3) Preload everything when Excel starts. This will hurt Excel start up time, but will make your menu selection speedier. You could also preload everything in the background, to help this.

Jacob Adams
#1 - the assemblies must be loaded in the Excel appdomain?#2 - Yes#3 - VSTO doesn't give you too many options... My beef, is that when excel starts, it just "appears to hang" as it has already shown the UI, but then hangs loading the assemblies. Bad Microsoft... Bad. Bad. :)
J Davis