Monday, 24 August 2009

Android XML parsing

CloudBank communicates with a REST server to read/write application data from/to the cloud. As our server speaks XML, we need to parse XML on the Android client. However, a quick look at the documentation reveals that Android has no less than three different XML parsers: the traditional DOM and SAX parsers plus the recently added XML Pull Parser, which promises to deliver high performance at a small memory footprint.

Great, this is exactly what we want: higher performance with less memory!

But does the promise hold up? Too lazy to set up my own performance test and confident that others have done that already, I dug up a recent article on Android XML parsing by Shane Conder. It describes a performance test for all three parsers with different data volumes, which surprisingly found the SAX parser to perform best on all three data sets.

1 comment: