是否可以使用 VS2010 分析器对 C# 中的主线程以外的线程进行采样 [英] Is it possible using the VS2010 profiler to sample a thread other than the Main Thread in C#

查看:62
本文介绍了是否可以使用 VS2010 分析器对 C# 中的主线程以外的线程进行采样的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试用 c# 分析一个应用程序,以前从未做过任何类型的分析.到目前为止,我无法在分析器上找到太多文档,也许这里的某个人可能更了解.

I'm trying to profile an app in c#, never done any kind of profiling before. I haven't been able to find much documentation on the profiler so far maybe someone here might know better.

我有一个应用程序,当我单击工具栏按钮时,它会启动一个后台线程来获取一些数据.然后准备好数据并显示在主线程上.我正在尝试分析此过程以确定所花费的时间是在准备数据还是在获取中,但我运气不佳.如果我使用 Sampling 模式,它只显示主线程,如果我使用 Concurrency 视图,它会给我大量的信息,比如争用等.

I have an app that when I click a toolbar button, kicks off a background thread to fetch me some data. The data is then prepared and displayed on the Main thread. I'm trying to profile this process to determine whether the time taken is in the preparation of the data or in the fetching, but I'm not having much luck. If I use the Sampling mode, it only displays the Main thread, if I use the Concurrency view, it gives me a load of information that I'm not after like contention etc.

如果有人知道可以提供帮助的东西,请干杯!

Cheers if anyone knows something that could help!

亚历克斯

推荐答案

VS 采样器在 I/O 期间被挂起,所以如果一个线程几乎所有的时间都花在 I/O 上,它看起来几乎没有花时间根本.另一方面,仪器应该抓住它.

The VS sampler is suspended during I/O, so if a thread spends nearly all its time in I/O, it will appear to be spending almost no time at all. On the other hand, instrumentation should catch it.

我最喜欢的方法是 在它工作时暂停它,并检查您喜欢的任何主题.

My favorite method is to just pause it while it's working, and examine any thread you like.

这篇关于是否可以使用 VS2010 分析器对 C# 中的主线程以外的线程进行采样的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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