4 ms·
Ironically, the whole iphone apps goldrush seems to have contributed in a big way to increase its mindshare. Obj-C is very beautifully designed, I especially li
by woadwarrior01 16y ago
Ironically, the whole iphone apps goldrush seems to have contributed in a big way to increase its mindshare. Obj-C is very beautifully designed, I especially like how it adds message passing OOP to C with very minimal syntax additions. But then calling objc_msgSend for every message send, does have a small performance penalty attached, which mostly static languages like C++ don't have to pay.
- wglb 16y agoSo does C++ have any price to pay for say vtables?
- woadwarrior01 16y agoThats why I called C++ `mostly static`.
- kragen 16y agovtables in C++ aren't free, but C++ has a couple of advantages here: • If you're calling a nonvirtual method, you don't have to pay the vtable cost at all, just the cost of passing this. And most methods in C++ are nonvirtual. • A call through a vtable is typically a couple of indexed fetches and an indirect jump. Objective-C's mechanism involves a hash-table lookup, which is a bit slower.
- rbanffy 16y ago> a small performance penalty attached, which mostly static languages like C++ don't have to pay. Then code the performance sensitive parts in C and link it from the language that is best suited to express the solution.