1

iPhone JSON Benchmarks

 2 years ago
source link: https://soffes.blog/iphone-json-benchmarks
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

iPhone JSON Benchmarks — Hi, I’m Sam

iPhone JSON Benchmarks — Hi, I’m Sam

Hi, I’m Sam

This is my blog. I also have a website thing.

iPhone JSON Benchmarks

Posted on November 4, 2009

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.

Parsing JSON with the iPhone's Private JSON Framework

Posted on November 3, 2009

So my post on Cocoa web services got a lot of attention when Gruber linked me the other day. This started a conversation on Twitter and basically ended up landing on using binary property lists over JSON for size and parsing, but that's for another blog post.

All of this got me thinking about how Apple does their JSON parsing, since they are obviously using JSON in several of the built in apps. I happened to notice that there was a JSON.framework in the Private Frameworks folder this evening. I tried class-dumping it and it surprising worked! (Most of the other private frameworks I tried to class-dump didn't produce any results.)

I figured what the heck, might as well try it. It turns out that it was really easy to implement. I posted a sample project demonstrating this on GitHub.

Continue reading →

© 2006-2022 Sam Soffes


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK