Mac OS X Reference Library Apple Developer
Search

Performance Considerations

Though key-value coding is efficient, it adds a level of indirection that is slightly slower than direct method invocations. You should use key-value coding only when you can benefit from the flexibility that it provides.

Additional optimization opportunities may be added in the future, but these will not change basic methods for key-value coding compliance.

Overriding Key-Value Coding Methods

The default implementations of the key-value coding methods, such as valueForKey:, cache Objective-C runtime information to increase efficiency. You should take care when overriding these implementations to ensure that you do not adversely affect application performance.

Optimizing To-Many Relationships

To-many relationships that are implemented using the indexed form of the accessors will provide significant performance gains in many cases.

It’s recommended that you implement at least the minimum indexed accessors for your to-many collections. See “Collection Accessor Patterns for To-Many Properties” for further information.




Last updated: 2010-04-28

Did this document help you? Yes It's good, but... Not helpful...