Re: How expensive are exceptions?
on Tue Jun 12 2007, Mathias Gaunard <loufoque-AT-gmail.com> wrote:
On Jun 7, 11:06 am, Jerry Coffin <jcof...@taeus.com> wrote:
Here's some data you might find interesting. These are results from
(part of) Joe Orost's bench++.
Result set 1: Microsoft C++ x64 edition [ what's this? ]
[...]
Result set 2: g++ 3.4 (mingW)
[...]
Result set 3: Microsoft VC++ 7.1 with SSE instructions enabled:
[...]
These were all run on the same machine. Of course, others will have
faster or slower machines than mine, but that's likely to affect all the
results by approximately a constant factor. This is probably semi-
representative of what to expect with a reasonably current desktop
machine of the x86 variety. My guess is that the ratio between
throw/catch and setjmp/longjmp will remain pretty large on most other
machines as well.
Testing GCC 4.2.0, preferably on linux, would probably be more
interesting than 3.4.0 on Windows.
Yes; IIUC no GCC implementation for windows has ever used the new GCC
ABI with its range-table-based EH implementation, which has been in
place on Linux at least since GCC 4 (I think actually since GCC 3).
Also I don't think the tests shown are measuring what most of us
should care about most of the time: the cost of EH on the non-error
path, i.e. when no errors actually occur -- as compared with a program
with the same error-handling semantics but not using EH.
It may also be interesting to test the Intel compiler, since they're
the ones who came up with the famous Itanium ABI for exception
handling.
IIUC it was a joint effort among a large group of vendors.
--
Dave Abrahams
Boost Consulting
http://www.boost-consulting.com
The Astoria Seminar ==> http://www.astoriaseminar.com
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]