How to improve cold start performance for the VSTO2SE MS Office add-in?

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

Cold start times are always bad in Excel 2003. I saw one test computer where start times are 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 without success:

  • Checking the certificate revocation list (checking certificate revocation) - this does not seem to help, and I cannot expect users to do this.

  • Use NGEN to create your own assemblies.
    a) It seems that Office 2003 never uses native builds. b) My Office 2007 test client, which starts quickly, does this even with IL builds. c) Even if I NGEN my entire description tree, there are still VSTO dependencies that may not have their own images.

  • Delay loading add-ons is a workaround "stock response" I get from Microsoft. The fact is that my add-in is launched from a menu item - how can I postpone loading the add-in and still get my menus? I could use the VB6 add-in to draw menus and forward calls through interop, but why would I even write the VSTO add-in first?

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

+4
source share
2 answers

You are about to strike a cold start because it must load all assemblies for the first time.

If a warm start is much faster, then the only real options you have are

1) Download a separate program download when windows start, and download all the builds for you in addin in the background.

2) Try to reduce the number of assemblies that you use. Of course, you should not use a lot with Hello World.

3) Preload everything when Excel starts. This will damage Excel startup time, but will make your menu selection faster. You can also preload everything in the background to help this.

+1
source

Have you checked what actual retention is? If you put the Debug.Write () statement on the first line in your VSTO add, will it take 15 seconds to display in the debug window?

We work with VSTO, and whenever we have delays, it is usually something other than the actual runtime that causes a slowdown. We solved this problem by dropping background threads to do slow things, without blocking the main thread that keeps Excel running.

ps. We are also not huge fans of VSTO technology. We are 100% buying a vision, but the implementation leaves much to be desired.

0
source

All Articles