|
|
|
|
|
by ridiculous_fish
2869 days ago
|
|
Do any statically compiled languages have inline caches? This would be a huge loss for ObjC, since it would greatly increase memory pressure by dirtying every text page. ObjC has per-class out-of-line caches keyed by the selector (intern'd string). It's true that there's no hope of inlining across a message send, but ObjC's C and C++ compatibility mitigates a lot of this expense. Apps routinely use C and C++ for perf critical sections. Also some of Apple's APIs are inline C functions (NSMakeRect, etc) and others are designed to minimize dynamic dispatch. Iterating an NSArray typically requires only one message send (see the NSFastEnumeration protocol). There's also more exotic techniques like IMP caching. |
|