472,363 Members | 1,935 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,363 software developers and data experts.

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 3050
<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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Jeff Sykes | last post by:
I have a cgi script that imports modules based on a user config file. I am suffering some performance problems when I import these modules. Some logging revealed that it seems to be taking about...
7
by: Michael Andersson | last post by:
Hi! Does the use of exception handling induce a performance penalty during the execution of non exception handling code? Regards, /Michael
6
by: Erik Cruz | last post by:
Hi. I have read several articles recommending avoid to raise exceptions when possible, since exceptions are expensive to the system. Removing code from Try... Catch blocks can help performance?...
59
by: kk_oop | last post by:
Hi. I wanted to use exceptions to handle error conditions in my code. I think doing that is useful, as it helps to separate "go" paths from error paths. However, a coding guideline has been...
25
by: Daniel P. | last post by:
MS or anyone still claims that C# and VB.NET generate the exact same IL code? http://www.osnews.com/story.php?news_id=5602&page=3
6
by: RepStat | last post by:
I've read that it is best not to use exceptions willy-nilly for stupid purposes as they can be a major performance hit if they are thrown. But is it a performance hit to use a try..catch..finally...
1
by: Anonieko | last post by:
Understanding and Using Exceptions (this is a really long post...only read it if you (a) don't know what try/catch is OR (b) actually write catch(Exception ex) or catch{ }) The first thing I...
3
by: gratch06 | last post by:
The application I'm working on will run on Linux, in user space. If I use exception handling in parts of the application, will that affect the performance of sections of code which do not use any...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.