|
Boost : |
Subject: Re: [boost] [inspect] exceptions (FW: [Boost-users] no exceptions)
From: Emil Dotchevski (emildotchevski_at_[hidden])
Date: 2011-03-25 14:54:58
On Fri, Mar 25, 2011 at 12:17 AM, Vladimir Prus
<vladimir_at_[hidden]> wrote:
> Emil Dotchevski wrote:
>
>> On Thu, Mar 24, 2011 at 8:03 PM, Gruenke, Matt <mgruenke_at_[hidden]> wrote:
>>> I did a little bit of performance testing and found BOOST_THROW_EXCEPTION to add about 45%
>>> overhead (CPU: Intel Xeon X5570; compiler: gcc-4.2.3; optimization: -O2) vs straight 'throw'
>>> of simple std::exception-derived class. So, it's not exactly free. That said, neither is
>>> blazingly fast.
>>
>> Could you clarify, what do you mean by overhead? Speed? Speed of
>> throwing an exception? Speed of catching an exception? Code size?
>> Compilation time?
>
> I think a different question is worth asking -- did you measure any of above?
No, I did not measure the overhead of throwing and catching class A
deriving from class B and std::exception vs. throwing and catching
class A deriving from std::exception only.
Honestly, I've never measured the speed of throwing and catching any
exceptions on any platform -- I tend to focus on whatever the profiler
points me to.
Emil Dotchevski
Reverge Studios, Inc.
http://www.revergestudios.com/reblog/index.php?n=ReCode
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk