BHO Load Time in IE9 - Dll loaded in Cache?
-
2011년 2월 4일 금요일 오전 11:19
Hi,
I've developped a BHO/ IE extension working on IE7, IE8 and IE9 for Windows XP, Vista and 7. I began to create the BHO from this excellent article in CodeProject . Since then, I've developped a lot of new functionalities and everything's working great.
Though, in IE9, the load time is highly random. It's a problem since IE9 shows a window to disable slow extensions if it's over 200ms by default (and I don't want the users to disable mine because of this!).
I ran some tests and saw that the load time is decreasing every time I launch IE9 with the extension enabled. Most of the time the load time for my BHO is under 100ms, but sometimes (mostly at first install), it's over 200ms and will appear red in IE popup to disable extensions. I did care to create the BHO the best way possible and not to slow user experience. The DLLGetClassObject doesn't contain more code than there initially was in the CodeProject code : I moved everything to take action later, when pages are loaded for exemple.
Is this happening because IE9 is storing my DLL in cache somewhere to launch it faster after some time? Is there a way to preload the BHO like this, or to enhance the code to decrease load time?
Thank you!
Valentin
모든 응답
-
2011년 2월 4일 금요일 오후 10:51
There is no way to preload.
You should read these articles from the IE blog:
- http://blogs.msdn.com/b/ie/archive/2010/08/03/add-on-performance-part-1-measuring-add-on-performance.aspx
- http://blogs.msdn.com/b/ie/archive/2010/08/31/add-on-performance-part-2-helping-consumers-make-informed-decisions.aspx
- http://blogs.msdn.com/b/ie/archive/2010/09/12/add-ons-measuring-performance.aspx
Then go have a look at what you're doing in your IObjectWithSite::SetSite() implementation, as well as various navigation event sinks. Ask yourself: Is this expensive? Does it do disk access? Does it load DLLs? Does it make synchronous network requests?
If you answer yes, try to find ways to do those things asynchronously on a background thread.- 답변으로 표시됨 Yi Feng LiModerator 2011년 2월 15일 화요일 오전 2:28
-
2011년 4월 7일 목요일 오전 7:25
There is no way to preload.
You should read these articles from the IE blog:
- http://blogs.msdn.com/b/ie/archive/2010/08/03/add-on-performance-part-1-measuring-add-on-performance.aspx
- http://blogs.msdn.com/b/ie/archive/2010/08/31/add-on-performance-part-2-helping-consumers-make-informed-decisions.aspx
- http://blogs.msdn.com/b/ie/archive/2010/09/12/add-ons-measuring-performance.aspx
Then go have a look at what you're doing in your IObjectWithSite::SetSite() implementation, as well as various navigation event sinks. Ask yourself: Is this expensive? Does it do disk access? Does it load DLLs? Does it make synchronous network requests?If you answer yes, try to find ways to do those things asynchronously on a background thread.I've read the articles and follow it in my add on. But when first start IE9 on system restart, the load time of my add on always costs about 250ms. I use windows performance tools and see: it costs 200ms between ExtensionCreate start/stop, and only 50ms between ExtensionSetSite start/stop.
In my add-on DLLGetClassObject() just do necessary work and return as soon as possible. I use OutputDebugString also see that.
So, my question is, how to optimizing the load time between ExtensionCreate start/stop?
-
2011년 4월 13일 수요일 오전 6:12
There is no way to preload.
You should read these articles from the IE blog:
- http://blogs.msdn.com/b/ie/archive/2010/08/03/add-on-performance-part-1-measuring-add-on-performance.aspx
- http://blogs.msdn.com/b/ie/archive/2010/08/31/add-on-performance-part-2-helping-consumers-make-informed-decisions.aspx
- http://blogs.msdn.com/b/ie/archive/2010/09/12/add-ons-measuring-performance.aspx
Then go have a look at what you're doing in your IObjectWithSite::SetSite() implementation, as well as various navigation event sinks. Ask yourself: Is this expensive? Does it do disk access? Does it load DLLs? Does it make synchronous network requests?If you answer yes, try to find ways to do those things asynchronously on a background thread.I've read the articles and follow it in my add on. But when first start IE9 on system restart, the load time of my add on always costs about 250ms. I use windows performance tools and see: it costs 200ms between ExtensionCreate start/stop, and only 50ms between ExtensionSetSite start/stop.
In my add-on DLLGetClassObject() just do necessary work and return as soon as possible. I use OutputDebugString also see that.
So, my question is, how to optimizing the load time between ExtensionCreate start/stop?
I have the same problem. Even I've removed all routines in SetSite() of BHO add-on, sometimes it still costs time more than 200ms, especially at first start IE after system restart.
My question is that are there any other specific factors of IE/system which will affect load time?, not just SetSite() or routines in BHO.
Thanks!
-
2012년 4월 19일 목요일 오후 7:43
I am starting to suspect that 200ms is pretty much the minimum it takes for a C# BHO even if you have no code at all.
I might try rewriting this in C++...

