Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > try and performance issues

Reply
Thread Tools

try and performance issues

 
 
Bit Byte
Guest
Posts: n/a
 
      09-13-2006
I am writing a messaging library which calls a method every few
milliseconds to dispatch mesagaes awaiting in a queue.

I wnat to wrap the method call with a try/catch, for more robust code,
but I am wondering if there will be a noticeable performance hit ? ..

 
Reply With Quote
 
 
 
 
Rolf Magnus
Guest
Posts: n/a
 
      09-13-2006
Bit Byte wrote:

> I am writing a messaging library which calls a method every few
> milliseconds to dispatch mesagaes awaiting in a queue.
>
> I wnat to wrap the method call with a try/catch, for more robust code,
> but I am wondering if there will be a noticeable performance hit ? ..


The best way to find out would be by measuring the performance for both
variants. Note that this depends on the compiler and its optimization
settings.


 
Reply With Quote
 
 
 
 
Jerry Coffin
Guest
Posts: n/a
 
      09-13-2006
In article <(E-Mail Removed)>, http://www.velocityreviews.com/forums/(E-Mail Removed)
says...
> I am writing a messaging library which calls a method every few
> milliseconds to dispatch mesagaes awaiting in a queue.
>
> I wnat to wrap the method call with a try/catch, for more robust code,
> but I am wondering if there will be a noticeable performance hit ? ..


You'll have to profile it with your implementation to know for sure, but
many compilers have virtually no overhead until/unless an exception is
actually thrown.

--
Later,
Jerry.

The universe is a figment of its own imagination.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
When to TRY and not to TRY =?Utf-8?B?QUo=?= ASP .Net 2 10-17-2007 03:24 AM
converting a nested try/except statement into try/except/else John Salerno Python 20 08-11-2006 02:48 PM
Can I have a second TRY inside the first TRY/CATCH in ASP.NET ??? bienwell ASP .Net 4 05-27-2005 05:05 PM
Compiler error occurred when try to use a flexible template expression in preprocessor definesCompiler error occurred when try to use a flexible template expression in preprocessor defines snnn C++ 6 03-14-2005 04:09 PM
Try, Try, Try, again... Rick12N4@netscape.net Computer Support 3 01-29-2005 04:02 PM



Advertisments