4

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

4

2 回答 2

1

您将在冷启动时受到打击,因为它必须第一次加载所有程序集。

如果热启动明显更快,那么您唯一真正的选择是

1)当windows启动时有一个单独的程序加载,并在后台为您加载所有程序集。

2)尽量减少你正在使用的程序集的数量。当然,你不应该在 Hello World 中使用太多。

3) Excel 启动时预加载所有内容。这会影响 Excel 的启动时间,但会使您的菜单选择更快。您还可以在后台预加载所有内容,以提供帮助。

于 2008-12-05T19:02:24.190 回答
0

您是否验证了实际的滞留量是多少?如果将 Debug.Write() 语句作为 VSTO 插件的第一行,是否需要 15 秒才能显示在调试窗口中?

我们正在与 VSTO 合作,每当我们遇到问题时,通常不是实际运行时导致减速的原因。我们已经解决了这个问题,方法是关闭后台线程以执行缓慢的操作,同时不阻塞阻止 Excel 启动的主线程。

附言。我们也不是 VSTO 技术的忠实拥护者。我们 100% 接受了这一愿景,但实施仍有很多不足之处。

于 2008-10-29T22:22:41.487 回答