Operating System - HP-UX
1756974 Members
1866 Online
108857 Solutions
New Discussion юеВ

Performance hit using exception handling using aCC

 
Alfred P. Bartholomai_1
Occasional Contributor

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.
Performance can slow down by a factor
of 10 to 1 or even more.

The online aCC documentation says:
http://docs.hp.com/en/5076/except.htm#EHperformance
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 Bartholomai
4 REPLIES 4
Stephen Keane
Honored Contributor

Re: Performance hit using exception handling using aCC

You will only get significant performance hits if the application is throwing a significant number of exceptions. Since exceptions are, well supposed to be the exception, the question you should be asking is why your application is throwing so many exceptions in the first place?
Stephen Keane
Honored Contributor

Re: Performance hit using exception handling using aCC

You wouldn't be trying to mix C++ compiled by two different compilers by any chance?
MAUCCI_2
Frequent Advisor

Re: Performance hit using exception handling using aCC

Hello,

what optim level are you using?
Are you using debug level?

Yes, a test case can be interesting.

++Cyrille
Dennis Handly
Acclaimed Contributor

Re: Performance hit using exception handling using aCC

>We are having some severe performance hits using exception handling (try/catch) scenarios. Performance can slow down by a factor of 10 to 1 or even more.

 

As Stephan said, this is to be expected.

 

>HP aC++ exception handling has no significant performance impact at compile-time or run-time.

 

This is if you don't actually throw.  This is compared to PA-RISC where using EH may drop optimization level or to an older cfront.

 

If you have a newer libunwind with Unwind Express, there have been a lot of speed ups.  Also the compiler has been fixed recently so that when optimization doesn't cause an unwind descriptor bloat that made aCC6 slower than g++.