确定什么阻止了UI线程 [英] Determine what is blocking UI thread

查看:54
本文介绍了确定什么阻止了UI线程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个相当大的.NET WPF实时应用程序.该应用程序运行正常,符合预期,除了一个BIG问题-UI更新缓慢.

I am working on a rather large .NET WPF real-time application. The application is working great and as expected, except for one BIG issue - UI Update is slow.

此应用程序是高度事件驱动的,所有事件都引发了各种事件-通过这些事件,UI得以更新.

This application is highly event driven, there are events raised all over for all sorts of things - through these events the UI is updated.

这些事件中的一个或很多正在阻止UI立即显示.完成所有工作后,UI将显示预期结果.

One or many of these events is blocking the UI from displaying immediately. When all the work is complete, the UI shows the expected results.

有什么方法可以确定导致瓶颈的事件处理程序吗?

Is there any way of determining which event handler is causing the bottleneck?

任何帮助将不胜感激.

推荐答案

我完全支持colithium关于使用探查器的建议.

I fully support colithium's suggestion of using a profiler.

此外,如果阻塞时间超过一秒钟,则可以在Visual Studio中单击暂停"按钮.在工具栏中,有一个下拉列表,您可以在其中选择主线程".然后跳转到当前阻止用户界面的方法.

In addition, if the blocking takes more than a second, you might be able to hit the "Pause" button in Visual Studio. In the tool bar, there's a dropdown list where you can choose the "Main Thread". Then it jumps to the method which is currently blocking the UI.

这篇关于确定什么阻止了UI线程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆