Reader Performance + Benchmarks

Shaun, Jan 14

The most common complaint (from myself included, it drives me crazy) about Reader 1.0 is that it takes too long to update.

Improving stability and performance of Reader was the primary focus of the 1.1 update that will be hitting App Store next week hopefully, so we'll talk a bit about what we did, and show you some benchmarks.

We went back into Reader and added support for GZip (as described here) content, which greatly reduced the amount of data the phone had to download, for example, Coding Horror's feed is 114KB, however when you accept GZip compressed data, it gets sent over as 39KB, a third of the size.

Another big improvement we added was callbacks to ASIHTTPRequest to check in when a feed has either an ETag or Last Modified header before it even begins to download the actual data (37signals touched on that here).  If we detect the ETag is the same as what we already have, or if the Last Modified date isn't any newer then what we have, we simply cancel the request and aside from a few bytes from the headers, no data is ever transferred.

We ran some benchmarks today to see where we're at and where the bottlenecks are now, and here's what we came up with based on an AT&T 3G connection on iPhone 3G running the 2.2 software:

The biggest bottleneck is still receiving data, as seen by the Digg feed taking nearly 4.5 seconds to go through.  Digg's feed is 80KB, it's too bad they don't use GZip encoding, or it would definitely be much faster..

Aside from parsing the XML of the feed and saving the items, nothing else takes much more then a few hundredths of a second.

The XML Parsing library that we use, KissXML, is constantly getting great speed improvements, so parsing will gradually get faster as time goes on.

The other thing we can work to improve is speeding up saving items, which we'll try to tackle by using better optimized queries and transaction sets.

All in all, Reader is definitely a lot faster, and will only continue to improve.  Once we speed up some more things, we'll post updated benchmark numbers and compare them side by side to see the changes.



blog comments powered by Disqus