473,544 Members | 1,944 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3124
<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
"performanc e 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.goo glegroups.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******** *************@z 14g2000cwz.goog legroups.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 "significan t 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
1909
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 1.3 seconds to import these modules. This is running on a Windows 2000 box with a Pentium II 400 processor, Python 2.1, Apache 1.3.19 as the web...
7
9236
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
552
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? The following 2 first lines of code - I think - can't raise exceptions: Try Dim str As String Dim intVar As Integer
59
4378
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 presented that says "Use conventional error-handling techniques rather than exception handling for straightforward local error processing in which a...
25
1879
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
2818
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 block, just in case there might be an exception? i.e. is it ok performance-wise to pepper pieces of code with try..catch..finally blocks that must be...
1
2371
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 look for when evaluating someone's code is a try/catch block. While it isn't a perfect indicator, exception handling is one of the few things that...
3
1321
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 exception handling? Basically, I'm looking at optimizing a critical path, and wondering if I can keep the exceptions elsewhere in code which are...
0
7420
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7362
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7602
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7368
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7704
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5904
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
4911
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
983
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
657
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.