Why @throw in Objective-C is an expensive operation? -
i heard notion of @throw expensive in objective-c, reason behind it? throw
in java expensive too?
"exceptions in objective c implemented using c primitive: longjmp(). objective-c not c++. may have many layers of method call between code raises exception , method catches it. easy write memory leak."
http://newsgroups.derkeiler.com/archive/comp/comp.sys.mac.programmer.help/2007-08/msg00020.html
also...
"a little more information.
c++ exceptions and, under modern abi, objective-c exceptions extremely cheap set (@try), expensive @throw , @catch.
when @throw happens, there heavy cost generating bits necessary unwind stack.
unfortunately, appkit has issue causes unwind info generated normal part of operation (without throwing exception).
thus, appkit operations in 64 bit can quite slow @ time.
b.bum"
Comments
Post a Comment