RestKit/RestKit — pull request #1967 by karlgluck (2014-07-02 15:05:59+00:00)
Title: Build the RKPathMatcher for a RKResponseDescriptor only once

In our project, we use RK extensively and have hundreds of response descriptors. We found that a major hotspot in returning data from the server was that RKFilteredArrayOfResponseDescriptorsMatchingPathAndMethod invokes RKResponseDescriptor's matchesPath selector for every response descriptor. Each request creates a new RKPathMatcher, which compiles an SOCPattern. The time for the compiling really starts to add up.

This code saves a pathPatternMatcher as a private variable in RKResponseDescriptor so that each descriptor only ever creates a RKPathMatcher once. Other than that, it behaves exactly as before.