<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>rel=me &#187; sbjson</title>
	<atom:link href="http://rel.me/t/sbjson/feed/" rel="self" type="application/rss+xml" />
	<link>http://rel.me</link>
	<description>programming, objective-c, cocoa, iphone, c</description>
	<lastBuildDate>Tue, 02 Feb 2010 04:04:35 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>JSON Parsing Speed Test: YAJL vs SBJSON (iPhone Edition)</title>
		<link>http://rel.me/2009/10/08/json-parsing-speed-test-yajl-vs-sbjson-iphone/</link>
		<comments>http://rel.me/2009/10/08/json-parsing-speed-test-yajl-vs-sbjson-iphone/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 06:18:57 +0000</pubDate>
		<dc:creator>gabe</dc:creator>
				<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[sbjson]]></category>
		<category><![CDATA[yajl]]></category>

		<guid isPermaLink="false">http://rel.me/?p=255</guid>
		<description><![CDATA[I was curious about the difference, if any, in performance between SBJSON and YAJL with Objective-C bindings. SBJSON is a strict JSON parser written in Objective-C. YAJL is a small event-driven (SAX-style) JSON parser written in ANSI C. Awhile back I wrote YAJL Objective-C bindings and I did some very basic speed tests on JSON [...]]]></description>
			<content:encoded><![CDATA[<p>I was curious about the difference, if any, in performance between SBJSON and YAJL with Objective-C bindings. <a href="http://code.google.com/p/json-framework/">SBJSON</a> is a strict JSON parser written in Objective-C. <a href="http://lloyd.github.com/yajl/">YAJL</a> is a small event-driven (SAX-style) JSON parser written in ANSI C. Awhile back I wrote <a href="http://github.com/gabriel/yajl-objc">YAJL Objective-C bindings</a> and I did some very basic speed tests on JSON data from twitter, delicious, last.fm and yelp. I ran these tests on the original, 3G and 3GS iPhones. </p>
<p>The SBJSON test ran <code>NSString#JSONValue</code>, and the equivalent YAJL test ran <code>NSData#yajl_JSON</code>. The YAJL bindings operate directly on NSData, and this makes a bit more sense since we usually have NSData first, whereas for SBJSON you have to decode to a string before parsing. I <strong>didn&#8217;t</strong> include this difference in my tests though.</p>
<p>These are tests of parsing only (and not loading of any data or strings) of the 4 APIs datasets run 100 times on the original iPhone, 3G and 3GS:</p>
<hr/>
<img src="http://rel.me/wp-content/uploads/2009/10/iphone.png" alt="iphone" title="iphone" width="575" height="320" class="aligncenter size-full wp-image-286" /></p>
<hr/>
<img src="http://rel.me/wp-content/uploads/2009/10/iphone3g.png" alt="iphone3g" title="iphone3g" width="595" height="320" class="aligncenter size-full wp-image-285" /></p>
<hr/>
<img src="http://rel.me/wp-content/uploads/2009/10/iphone3gs.png" alt="iphone3gs" title="iphone3gs" width="503" height="320" class="aligncenter size-full wp-image-284" /></p>
<hr/>
<p>So the YAJL framework gives about a 60% speed increase. The YAJL Objective-C bindings can be found on <a href="http://github.com/gabriel/yajl-objc">github</a>.</p>
<p>Be sure to thank <a href="http://twitter.com/lloydhilaiel">@lloydhilaiel</a> for making <a href="http://lloyd.github.com/yajl/">YAJL</a> full of so much awesomeness.</p>
<p><b>Update</b>: The project used to do the perf test can be found <a href="http://github.com/gabriel/json-objc-perf">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://rel.me/2009/10/08/json-parsing-speed-test-yajl-vs-sbjson-iphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
