测量C ++中的异常处理开销 [英] Measuring exception handling overhead in C++

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

问题描述



请提供独立的代码示例。



我的目标是Microsoft Visual C ++ 2008和gcc。



我需要从以下情况得到结果:


  1. 没有try / catch块时的开销

  2. 有try / catch块但是没有抛出异常的开销

  3. 抛出异常时的开销


解决方案

C ++性能技术报告草案完全专注于例外。


What is the best way to measure exception handling overhead/performance in C++?

Please give standalone code samples.

I'm targeting Microsoft Visual C++ 2008 and gcc.

I need to get results from the following cases:

  1. Overhead when there are no try/catch blocks
  2. Overhead when there are try/catch blocks but exceptions are not thrown
  3. Overhead when exceptions are thrown

解决方案

Section 5.4 of the draft Technical Report on C++ Performance is entirely devoted to the overhead of exceptions.

这篇关于测量C ++中的异常处理开销的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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