【发布时间】:2015-11-04 17:35:54
【问题描述】:
我的日志库中有这段代码
var stackTrace = new StackTrace();
string operationName = stackTrace.GetFrame(1).GetMethod().Name;
根据我使用 PerfView 工具进行的性能分析,它显示为
有人知道我添加的代码对性能的影响吗? 如果是,有没有其他方法可以让我获得方法名称而不会对性能产生更大的影响?
我目前在 4 核机器上以 1000 TPS 的速度运行它。而且我看到它使用了我 15.1% 的 CPU
【问题讨论】:
标签: c# performance perfview