.Net Profiler - 由于辅助函数注入而产生的开销 [英] .Net Profiler - Overhead due to helper functions injection

查看:68
本文介绍了.Net Profiler - 由于辅助函数注入而产生的开销的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我在NopCommerce示例电子商务MVC应用程序中部署了我的dot net instrumentation探测器。 



没有我的分析器w3wp.exe的%CPU是~51%,当我的分析器连接时,CPU变为~62%。我猜它是由于我处理的行(获取函数的执行时间,函数执行流程等)。 



但是  即使我发表评论帮助程序集函数中的所有代码 (我从分析器中注入的C#函数定义
)%CPU是~61%。 (即)注入的函数将在不进行任何处理的情况下返回。



从这些值我确信只需调用我的探查器注入的辅助函数(驻留在GAC中的只占用大部分CPU。 



为什么会发生这种情况。这是正常的吗?或者 任何减少CPU的想法都会因为仪器而消耗掉。? 

解决方案

嗨Selva VS,


感谢您在此发帖。


对于您的问题,我们无法确保导致CPU从51%到61%的原因。您可以使用

诊断工具窗口
,了解提升CPU的位置。


请检查以下链接。它显示了查看CPU和内存消耗的步骤。


https://blogs.msdn.microsoft.com/visualstudio/2016/02/15/analyze-cpu-memory-while-debugging/


然后你就可以知道提高CPU的位置了。


最好的问候,


Wendy


 


I have deployed my dot net instrumentation profiler in NopCommerce sample ecommerce MVC application. 

Without my profiler the % CPU of the w3wp.exe is ~51% and when my profiler gets attached the CPU becomes ~62%. I was guessing it due to the lines where i process (to get function's execution time ,function execution flow etc..). 

But even if i comment all the codes in the helper assembly functions(C# function definitions that i inject from profiler) the % CPU is ~61%. (i.e) the injected functions will just return without doing any kinda processing.

From these values i am sure that just calling the helper functions that my profiler injects (which resides in the GAC) only eats up most of CPU. 

Why this happens.? Is that normal one? Or  Any ideas to decrease the CPU eat up that caused due to instrumentaion.? 

解决方案

Hi Selva VS,

Thank you for posting here.

For your question, we could not make sure that what cause the CPU from 51% to 61%. You could use Diagnostic Tools window to know where raise the CPU.

Please check the following link. It shows the steps to look at your CPU and memory consumption.

https://blogs.msdn.microsoft.com/visualstudio/2016/02/15/analyze-cpu-memory-while-debugging/

Then you could know where raise the CPU.

Best Regards,

Wendy

 


这篇关于.Net Profiler - 由于辅助函数注入而产生的开销的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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