Under the Bridge

Library: TBXML

Here’s a new tool for your iPhone bag of programming tricks: the TBXML library. Yep, an XML parser, eponymously enough; and why do we draw attention to yet another of those? Why, because

TBXML is a light-weight XML document parser written in Objective-C designed for use on Apple iPhone / iPod Touch devices. TBXML aims to provide the fastest possible XML parsing whilst utilising the fewest resources. This requirement for absolute efficiency is achieved at the expence of XML validation and modification. It is NOT possible to modify and generate valid XML from a TBXML document and NO validation is performed whatsoever whilst importing and parsing an XML document.

Well, that suits a good number of applications. As discussed on 71^2 here:

… the difference is speed is truly amazing. The TMX file I was passing was taking between 15-20 seconds and with the new parser its down to 600ms …

… It also supports gzip as well … This brought the file size down from almost 2MB to 4KB.

Yep, that’s a pretty epic win alright, multiple orders of magnitude reduction in both space and time. Not bad indeed. If you have an application with significant static data requirements, this looks like a mighty compelling approach!