Hi, I'm Sam.

I like to create software, make music, and write about technology.

Find out more about me.

#benchmarks Posts

iPhone JSON Benchmarks

Posted in benchmarks, cocoa, development, iphone, and json

Update: Check out my updated benchmarks.

Yesterday I wrote a post on parsing JSON with Apple's private framework. I thought it might be worth benchmarking TouchJSON, JSON Framework, and Apple JSON (what I'm calling the private framework). My results were very interesting.

JSON Benchmarks

I know I posted awhile ago that TouchJSON was really fast, but I guess I got my numbers mixed up. This time I ran each test 100 times and took the average. These are the numbers from TouchJSON 1.0.6 and JSON Framework 2.2.2 running on my iPhone 3GS compiled for iPhone OS 3.1. You can get the code on GitHub and see for yourself.

In conclusion, *it looks like JSON Framework is the one to use*, since you probably shouldn't use Apple JSON in a shipping app. JSON Framework was always my favorite for the clean, category-style interface. I only tested Apple JSON to see how the other implementations compared to it.

Updated iPhone JSON Benchmarks

Posted in benchmarks, cocoa, development, iphone, and json

Update: You can see the latest benchmarks at https://github.com/samsoffes/json-benchmarks. The results change quite a bit, so I'd recommend just running the code and seeing who wins.

I wrote a post awhile ago about JSON benchmarks. I was telling a friend he should use JSON Framework based on my old benchmark post. He asked if I had run them again recently, so I figured I'd run them again.

I updated my test app and added a new library called YAJL based on a C library. My results were very similar to before. This time I tested it on an iPad and iPod Touch.

16GB 1st Gen iPad running iOS 3.2

8GB 3rd Gen iPod Touch running iOS 3.1.3

Results

On both devices, they ranked Apple JSON, YAJL, JSON Framework, and TouchJSON. You can read the detailed results on GitHub.

In conclusion, *it looks like YAJL is the new one to use*. Again, feel free to check out my code on GitHub.