Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

ChaosEngine

Exception handling

This topic is 5690 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

theoretical question: how much of a performance impact do exceptions have? Is it better to use return codes? "That''s not a bug, it''s a feature!" --me

Share this post


Link to post
Share on other sites
Advertisement
quote:
Original post by ChaosEngine
theoretical question: how much of a performance impact do exceptions have? Is it better to use return codes?


Exceptions are usually implemented so as to give as little overhead as possible (normally), and then take a bigger performance hit if an exception is actually raised.

That said, using exceptions is known to break optimization paths in some cases which could hurt (if an exception is raised, the execution has to be broken cleanly and a jump to a different part of the code needs to be possible without breaking things). Here is a small note about it on one compiler.

I''d defenitely suggest against using exceptions in a high-performance application since enabling exceptions cause a slowdown and as it''s impossible to disable them just for certain parts.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!