Fast enumeration not faster than any for loop. In a general sense, this is not possible, since the base loops are already optimized as they can be.
Instead, Fast enumeration is faster than a "for" or "while" loop, which extracts data at each iteration from an Objective-C object by calling the Objective-C method.
He does this by receiving data in packets, reducing the overhead of calling the method at each iteration. Removing a method call from the inside of the loop also has the benefits of optimizing the compiler.
Parag bafna
source share