C#中的异常有多昂贵? [英] How expensive are exceptions in C#?

查看:89
本文介绍了C#中的异常有多昂贵?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

C#中的异常有多昂贵?只要堆栈不深,似乎它们不是非常昂贵的;但是我已经阅读了有冲突的报道。



有没有被证实的明确报告吗?

解决方案

Jon Skeet撰写了例外与性能在2006年1月的.NET



哪些已更新异常和性能Redux (感谢@Gulzar)



哪个Rico Mariani在 .NET异常的真正成本 - 解决方案






另请参考:Krzysztof Cwalina - 设计指南更新:异常投掷


How expensive are exceptions in C#? It seems like they are not incredibly expensive as long as the stack is not deep; however I have read conflicting reports.

Is there definitive report that hasn't been rebutted?

解决方案

Jon Skeet wrote Exceptions and Performance in .NET in Jan 2006

Which was updated Exceptions and Performance Redux (thanks @Gulzar)

To which Rico Mariani chimed in The True Cost of .NET Exceptions -- Solution


Also reference: Krzysztof Cwalina - Design Guidelines Update: Exception Throwing

这篇关于C#中的异常有多昂贵?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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