CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: try catch(...)

  1. #1
    Join Date
    Sep 2003
    Posts
    815

    try catch(...)

    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

  2. #2
    Join Date
    May 2000
    Location
    KY, USA
    Posts
    18,652

    Re: try catch(...)

    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...

  3. #3
    Join Date
    Oct 2002
    Location
    Singapore
    Posts
    3,128

    Re: try catch(...)

    ... which is why try-catch is used for exceptioinal error. IMHO, errors that occur frequently should avoid using try-catch.

  4. #4
    Join Date
    Oct 2000
    Location
    London, England
    Posts
    4,773

    Re: try catch(...)

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured