.Net (2.0) Asynchronous Thread vs. UI Thread Performance [closed]
I am looking for an explanation into why when I run code that does some heavy recursive processing on the UI thread the code executes in around 90 secounds. Yet when I run the same code on an Asynchronous thread (not the UI thread) the code executes almost instantly? Any explanation would be appreciated.
TY, Josh
There could be a handful of answers. If you are updating databound data fields then the UI may be doing a lot of work to render the updated data. This could cause your processing to slow down many orders of magnitude.
Also, if you are on a memory constrained machine and you have a large UI, then you may be hitting memory limitations while you have th UI open. Perhaps you are thrashing around in the page file.
Also, it may be possible depending on your type of UI that there are stack size or other limitations which you are running into which are not present when the code is run on a different thread.
Is your UI catching any events that could be thrown from data altered by your recursive processing?
精彩评论