If I have a very large function body which contains several
calls to functions which throw similar exceptions is it less
costly to have several try/catch blocks or one try/catch block
for the entire function body. Lets assume that the catch blocks
all perform the same function.
Wakeup in the morning and kick the day in the teeth!! Or something like that.
"i don't want to write leak free code or most efficient code, like others traditional (so called expert) coders do."
well if they perform the same function, then why not catch(...) unless you are looking at the exception....so I know soul this isn't what you are looking for, so explain a bit more....
what is mean is say F1, F2, ...., FN throw exceptions
and I have
PHP Code:
void FOO()
{
F1();
...
F2();
...
...
...
FN();
}
As I understand it (which is not very well) I am going to pay
a price for having to keep track of code within try/catch for
stack unwinding. Now is this price worse if I use
just one try and multiple catchs...it matters not what is thrown, that a catch is there...you could disassembly it and look, but I would gather that the optimizer for the compiler would be the same....and no I haven't looked dumpbin /disasm .exe/.dll if your interested...
Bobby Schmidt's 17 part exception series in the MSDN talks about
some overhead in section 4: even looks at the generated asm.
Maybe some details for you ? Probably different in VC7.
Originally posted by mdmd
Bobby Schmidt's 17 part exception series in the MSDN talks about
some overhead in section 4: even looks at the generated asm.
Maybe some details for you ? Probably different in VC7.
Originally posted by Mick
You should have stated at part 1....these go to 17,,,,
I started from 17 and went backwards thinking he wouldn't be
"spelunking a tiny way into assembly language" untill the
end; I never made it to part 1.
Its good enough to read through again fully. Next time I'll start
from Handling Exceptions in C and C++, Part 1
Originally posted by mdmd
I started from 17 and went backwards thinking he wouldn't be
"spelunking a tiny way into assembly language" untill the
end; I never made it to part 1.
Its good enough to read through again fully. Next time I'll start
from Handling Exceptions in C and C++, Part 1
I only glanced through...seemed like a good read, and after all it's 17 parts..what can be wrong with that??? unless yer a liberal then it's really wrong
Bookmarks