开发者

.Net (2.0) Asynchronous Thread vs. UI Thread Performance [closed]

It's difficult to tell what is being asked here. This question is ambiguou开发者_Go百科s, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 10 years ago.

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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜