c# - .NET:典型的垃圾收集器开销是多少?

标签 c# .net clr

5% 的执行时间花在了 GC 上? 10%? 25%?

谢谢。

最佳答案

This blog post对该领域进行了有趣的调查。

海报的结论?对于他的示例,开销可以忽略不计。

So the GC heap is so fast that in a real program, even in tight loops, you can use closures and delegates without even giving it a second’s thought (or even a few nanosecond’s thought). As always, work on a clean, safe design, then profile to find out where the overhead is.

关于c# - .NET:典型的垃圾收集器开销是多少?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2267394/

相关文章:

c# - 我需要从页面上生成的动态控件中获取按钮点击的值(value)

flash - 在要进行 GC 的对象中将引用设置为 null?

c# - 如何编辑asp.net项目的dll文件方法

.net - Powershell 函数参数类型 System.ConsoleColor - 函数参数列表中缺少 ')'

.net - linq 查询连接两个表并从另一个表中获取一个表值的计数

.net - 在 XAML 中有没有办法将 UpdateSourceTrigger 默认为 PropertyChanged?

C# 泛型 : Constraining T where T : Object doesn't compile; Error: Constraint cannot be special class 'object'

c# - 为什么 C# 不支持通过引用传递的运算符重载?

c# - 合并两个 XML 文件并添加缺少的标签和属性

c# - ConfigurationManager.GetSection 和 Configuration.GetSection 有什么区别?