Click to See Complete Forum and Search --> : try catch(...)


avi123
May 28th, 2005, 11:25 PM
Hi,

I was wondering if using try catch reduce speed (performance)
if so does using a general try catch (with catch(...) and not a specific catch) decrease performance even more?

I'm not asking here about the code stability what I'm interested in is performance (by mean of speed)

Thanks in advance
avi123

Andreas Masur
May 29th, 2005, 02:22 AM
Exception handling in general will most-likely decrease the processing speed in case any exceptions are being thrown. If not, the code behaves the same as without exception handling...

Kheun
May 29th, 2005, 07:56 PM
... which is why try-catch is used for exceptioinal error. IMHO, errors that occur frequently should avoid using try-catch.

NMTop40
May 30th, 2005, 05:58 PM
I only normally throw exceptions when there has been a user error, which can include an environmental error, i.e. a file not existing that should (or could not be opened because of permissions etc), or invalid data etc.