ASPX Load controls from SQLDataSources CONCURRENTLY
I have many controls on my aspx page (DropDownLists) each bound to a SQLDataSource.
They stored proc takes a long time to run. I have been working with the DBAs for weeks to try to speed them up. We got it down to about 1-2 seconds for the slowest ones. However loading eight of these one a page is too long for a user to wait!
So, I would like to know if there is a way to get these controls to load concurrently, rather than consecutively?
I ran 32 of these slow procs in SSMS and it took 38 seconds. I ran 4 sets of these 32 procs at the same time in SSMS and they took 42-43 seconds. so it went from 1.19 sec per proc to .34 sec per proc. I would like to use these same metho开发者_StackOverflow社区dology in my aspx.net web page.
SUMMARY: Can I force the sql data sources to load concurrently rather than consecutively.
EDIT: Could I maybe call DataBind manually in my C# code rather than having it do it automatically. I could then start a new thred for each call to DataBind... Might this work?
You should look at asynchronous pages or async ADO.NET: http://msdn.microsoft.com/en-us/magazine/cc163725.aspx
It seems to me that caching might be a better solution here. Also, using multiple result sets in the same procedure.
You could use jquery / ajax / httphandlers (or methods marked as [webmethod] on your page) / json for loading dropdown combos information. With this, you could query in parallel and you would have a much more responsive interface.
You will have more development work, but better performance and better control over interface.
精彩评论