json

JSON and Objective-C

The XML vs. JSON debate will flame on until another popular data-interchange format comes along.  There are lots of opinions out there, but, sometimes, regardless of your opinion on the matter, a project calls for JSON.  For .NET projects, the library of choice is James Newton-King’s Json.NET.  But, until recently, those developing on Macs didn’t have a strong (i.e., fast) solution.  That is – until the screaming JSONKit came on the scene.

JSONKit is a “very high performance Objective-C JSON library” licensed under the BSD License and Copyright © 2011, John Engelhart.  It supports NSString and NSData interfaces, has a nice set of parsing options, deserializes 23% Faster than a Binary .plist and serializes 549% Faster than a Binary .plist!

Note: The JSON to be parsed by JSONKit MUST be encoded as Unicode, preferably in UTF-8 format.

The code, benchmarks, and primitive mapping details are available at Github.  You can get it here: https://github.com/johnezang/JSONKit.

Though not as performant, another Objective-C based parser for JSON is TouchJSON, based on Jonathan Wight’s CocoaJSON.   It is available here: https://github.com/TouchCode/TouchJSON.

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.