Home:

Home

An Objective-C runtime library

While studying the GNU Objective-C runtime, I wondered if it might be possible to address one of the most common complaints leveled at Objective-C: that its dynamic nature makes it too slow to be used for time-critical applications, such as a game engine. The most obvious place to look for this loss of speed is in the messaging code, since unlike traditional object-oriented languages, method calls are not linked to method implementations until runtime.

The use of sparse arrays in the GNU runtime is inspired, particularly when compared to the hacks and workarounds that Apple implemented in order to speed up their hashtable-based implementation. In considering whether or not the runtime could be made faster, I knew I wanted to keep the sparse array idea. I also identified a few places where I thought the runtime library itself might be made more efficient. For example, the GNU runtime builds an entire class hierarchy in order to ensure that +load is run in the correct order -- that is, that the method of a superclass is executed before the method of its subclasses. I thought there might be simpler ways to approach the problem.

Three years later, the result of my studies and tinkering is the Polar Objective-C runtime.

Continue reading...