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"

http://www.cocoabuilder.com/archive/cocoa/217947-cocoa-application-running-very-slow-under-64-bit.html


Comments

Popular posts from this blog

php - Zend Framework / Skeleton-Application / Composer install issue -

c# - Better 64-bit byte array hash -

python - PyCharm Type error Message -