bontoJR/iOS-JSON-Performance — pull request #4 by johnezang (2011-12-19 02:38:06+00:00)
Title: Add some additional JSONKit parsing techniques

> Quickly hack in some of the additional ways that JSONKit can do parsing, all of which are faster than `objectFromJSONString:`.

This is a quick hack to bolt on some of the other ways JSONKit can do parsing, all of which are faster than the original `objectFromJSONString:` way used in the original benchmark.

Probably the easiest and biggest win is to switch to `objectFromJSONData:`, in which you pass a `NSData` object containing UTF8 encoded JSON. This saves the (considerable) overhead of having to convert the `NSString` in to UTF8.

The *Thread ways demonstrate using a persistent `JSONDecoder` object, which can be a big win if you're parsing a periodically updating feed, like the twitter time line. With a persistent decoder, the decoder is able to re-use the cache from the previous parse, which can be a huge win if the JSON your parsing tends to repeat a lot (ala twitter feeds, etc).