Exception handling
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
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement