Quote:Over generalize much?
I missed that original quote included exception propagation as well.
Originally I referred to impact of exceptions-based code vs. the cost of what happens once the exception is thrown - which will inevitably be costly.
Quote:Over generalize much?
Quote:Original post by Numsgil
Since exceptions should be relatively rare, and only occur when something EXCEPTIONal happens, something that wasn't expected. Performance should be the least of your worries in these cases.
Quote:Original post by Antheus
I missed that original quote included exception propagation as well.
Quote:Use exceptions until you've profiled your application and determined that exceptions cost too much.
Program Code Size Time (no throws) Time (with throws)XBench.c 4.6k 1392 ms 1362 msCPPBench.cpp 35.3k 1492 ms 71343 ms
Quote:Since exceptions should be relatively rare, and only occur when something EXCEPTIONal happens, something that wasn't expected. Performance should be the least of your worries in these cases.
Quote:Original post by Jan WassenbergQuote:Use exceptions until you've profiled your application and determined that exceptions cost too much.
Bwahahaa! There's nothing like failing to look before you leap; the end result may be something you'd like to change, but simply can't because there's way too much that depends on it.
Time for some due diligence beforehand: (http://www.on-time.com/ddj0011.htm; the numbers are somewhat dated, but quite interesting)Program Code Size Time (no throws) Time (with throws)XBench.c 4.6k 1392 ms 1362 msCPPBench.cpp 35.3k 1492 ms 71343 ms
Quote:Umm, you do realize that those time differences are showing how long it takes to throw 0 exceptions, vs throwing and catching 1,000,000 exceptions?
Quote:Original post by bulgurmayoJust this week I watched a Microsoft video at work, about how exception handling was implemented. On WIN32 functions with exception information are added-to / removed-from a linked list upon entry and exit. This means that simply using exception handling adds a certain overhead, but throwing is not as costly as it might otherwise be.
Anybody knows a good link describing in details how C++ exceptions are implemented for the most common compiler/platform.
Quote:Original post by iMalc
Just this week I watched a Microsoft video at work, about how exception handling was implemented. On WIN32 functions with exception information are added-to / removed-from a linked list upon entry and exit.