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.
如果您创建一个针对Microsoft Office Excel 2003的简单“Hello World”VSTO2SE加载项,则在冷启动时加载需要15秒。在此期间,Excel完全没有响应。
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)
在Excel 2003中,冷启动时间总是很差。我在Excel 2007中看到了一台启动时间即时的测试机器,但我所有其他测试机器都需要15秒才能初始化。 (测试环境 - windows xp pro + VSTO2SE运行时+ XP SP3)
How can this performance be improved?
如何改善这种表现?
Things I've already tried with no success:
我已经尝试过的事情没有成功:
-
Disasble CRL (certificate revoke list) checking - this doesn't seem to help, plus I can't expect users to do this.
Disasble CRL(证书撤销列表)检查 - 这似乎没有帮助,加上我不能指望用户这样做。
-
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.使用NGEN创建本机程序集。 a)似乎Office 2003从不使用本机程序集。 b)我的office 2007测试客户端快速启动,即使使用IL程序集也是如此。 c)即使我NGEN我的整个依赖树,仍然存在可能没有本机图像的VSTO依赖项。
-
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?
延迟加载加载项 - 这是我从Microsoft获得的解决方法“库存响应”。问题是,我的加载项是从菜单项启动的 - 如何延迟加载加载项仍然可以获取菜单?我可以使用VB6加载项来绘制菜单并通过互操作转发调用,但是为什么我甚至会首先编写VSTO加载项?
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
编辑 - 是的,这是加载项中“连接”事件的唯一一行。 (实际上是消息框)..消息框出现前需要整整15秒。 - J戴维斯
2 个解决方案
#1
1
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.
1)在Windows启动时单独加载程序,并在后台加载所有程序集。
2)Try to reduce the number of assemblies you are using. Granted, you shouldn't be using much with Hello World.
2)尝试减少正在使用的组件数量。当然,你不应该使用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.
3)在Excel启动时预加载所有内容。这将损害Excel启动时间,但会使您的菜单选择更快。您也可以在后台预加载所有内容,以帮助实现这一目标。
#2
0
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?
你有没有验证实际的持有量是多少?如果将Debug.Write()语句作为VSTO插件中的第一行,是否需要15秒才能显示在调试窗口中?
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.
我们正在使用VSTO,每当我们持有时,它通常不是实际的运行时导致减速。我们通过分离后台线程来解决这个问题,以便在不阻塞主线程的情况下执行缓慢的操作,从而阻止Excel启动。
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.
PS。我们也不是VSTO技术的忠实粉丝。我们100%购买了这个愿景,但实施还有很多不足之处。
#1
1
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.
1)在Windows启动时单独加载程序,并在后台加载所有程序集。
2)Try to reduce the number of assemblies you are using. Granted, you shouldn't be using much with Hello World.
2)尝试减少正在使用的组件数量。当然,你不应该使用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.
3)在Excel启动时预加载所有内容。这将损害Excel启动时间,但会使您的菜单选择更快。您也可以在后台预加载所有内容,以帮助实现这一目标。
#2
0
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?
你有没有验证实际的持有量是多少?如果将Debug.Write()语句作为VSTO插件中的第一行,是否需要15秒才能显示在调试窗口中?
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.
我们正在使用VSTO,每当我们持有时,它通常不是实际的运行时导致减速。我们通过分离后台线程来解决这个问题,以便在不阻塞主线程的情况下执行缓慢的操作,从而阻止Excel启动。
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.
PS。我们也不是VSTO技术的忠实粉丝。我们100%购买了这个愿景,但实施还有很多不足之处。