469,964 Members | 1,546 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,964 developers. It's quick & easy.

Performance hit using exception handling using aCC

We are using HP aCC compiler on a HP Itanium box ( 11.23)

We are having some severe performance hits using exception
handling ( try/catch ) scenarios.

The online aCC documentation says:
HP aC++ exception handling has no significant performance impact at
compile-time or run-time.

We have not found this to be the case at all.

We are using the caliper measurement tool and it seems to indicate
that the application is spending 50% or more of it cpu cycles
in the unwind library.

We are not using any special arguments to aCC as exception handling
is enabled by default.

I can provide a simple short example to illustrate the case if needed
or requested.

Any comments, suggestions, ideas would be mucn appreciated.
Thank you,

Fred B.

Jul 22 '05 #1
4 2959
<cross-posts removed>

zzfreddybb wrote:
We are using HP aCC compiler on a HP Itanium box ( 11.23)

We are having some severe performance hits using exception
handling ( try/catch ) scenarios.

The online aCC documentation says:
HP aC++ exception handling has no significant performance impact at
compile-time or run-time.

We have not found this to be the case at all.

We are using the caliper measurement tool and it seems to indicate
that the application is spending 50% or more of it cpu cycles
in the unwind library.


This seems to imply that the performance hit you refer to is incurred
during exception processing - i.e. when exceptions are actually thrown.
So is your code actually throwing a lot of exceptions? If so, then the
"performance hit" sounds entirely reasonable; there will inevitably be
an overhead associated with stack unwinding, etc. I'm sure your
compiler documentation would not claim that *processing* exceptions
incurs no performance penalty.

FWIW, I found using gcc on a Win32 system that - despite claims to the
contrary by the compiler documentation - just *enabling* exception
handling incurred a performance (speed) hit of roughly 20% under heavy
floating-point number-crunching, *even when no exception handling
(try/catch blocks) was present in the code* ...
Regards,

--
Lionel B

Jul 22 '05 #2

"zzfreddybb" <fr**************@acsatl.com> skrev i en meddelelse
news:11**********************@z14g2000cwz.googlegr oups.com...
We are using HP aCC compiler on a HP Itanium box ( 11.23)

We are having some severe performance hits using exception
handling ( try/catch ) scenarios.

The online aCC documentation says:
HP aC++ exception handling has no significant performance impact at
compile-time or run-time.

We have not found this to be the case at all.

We are using the caliper measurement tool and it seems to indicate
that the application is spending 50% or more of it cpu cycles
in the unwind library.

We are not using any special arguments to aCC as exception handling
is enabled by default.

I can provide a simple short example to illustrate the case if needed
or requested.

Any comments, suggestions, ideas would be mucn appreciated.
Thank you,

Fred B.


I do not know your compiler, but my guess is lots of exceptions get thrown.
In that case your program is likely to pay for that. Exceptions should be
the exceptional, and if you do use them for other purposes, it is not unfair
that you pay for the performance hit. Restructure your code so that
exceptions only are thrown in exceptional cases.
Apart from that, you should post to a newsgroup dedicated to your compiler.

/Peter
Jul 22 '05 #3

"Lionel B" <go****@lionelb.com> skrev i en meddelelse
news:11*********************@z14g2000cwz.googlegro ups.com...
<cross-posts removed>

zzfreddybb wrote:
[snip]

FWIW, I found using gcc on a Win32 system that - despite claims to the
contrary by the compiler documentation - just *enabling* exception
handling incurred a performance (speed) hit of roughly 20% under heavy
floating-point number-crunching, *even when no exception handling
(try/catch blocks) was present in the code* ...
This is the case under win32 where i believe exception handling is
implemented at it is in Visual C++. There, code is injected to take care of
the stack unwinding. Under Linux, g++ will use another approach with no
effects on runtime when exceptions are not thrown.

/Peter
Regards,

--
Lionel B

Jul 22 '05 #4
zzfreddybb (fr**************@acsatl.com) wrote:
: HP aC++ exception handling has no significant performance impact at
: compile-time or run-time.
: We have not found this to be the case at all.

As Peter says, this means you have no "significant performance impact", if
you don't use throw.

: Any comments, suggestions, ideas would be much appreciated.
: Fred B.

A future version (around May 2005 or so) of the unwind library
(Unwind Express) will be 10 X faster in trivial cases.
Also, are you using threads?
From: "Peter Koch Larsen" <pk*****@mailme.dk>
In that case your program is likely to pay for that. Exceptions should be
the exceptional, and if you do use them for other purposes, it is not unfair
that you pay for the performance hit. Apart from that, you should post to a newsgroup dedicated to your compiler.


That would be the CXX-DEV mailing list. See:
http://h21007.www2.hp.com/dspp/comm/...,1273,,00.html
Jul 22 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Jeff Sykes | last post: by
7 posts views Thread by Michael Andersson | last post: by
6 posts views Thread by Erik Cruz | last post: by
59 posts views Thread by kk_oop | last post: by
6 posts views Thread by RepStat | last post: by
1 post views Thread by Anonieko | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.