TBXML

TBXML is a very fast, light-weight XML document parser written in Objective-C designed for use on Apple iPad, iPhone & iPod Touch devices.

See www.TBXML.co.uk for more information

Saturday, 6 March 2010

TBXML Performance

I have been meaning to download a number of XML parsers and stuff them all into an app to test out their performance along side TBXML. Fortunately, Ray Wenderlich has recently posted with an app that does exactly this!

He's put together a really good comparison of the different XML parsers available for the iPhone, listing their different features as well as performance comparisons.

It turns out that TBXML is the fastest parser out there. It's even faster libxml2! So if you need to parse a large XML document very quickly, TBXML is the one to choose!

However, libxml2 is a very capable XML parser with some more advanced features than what TBXML is able to offer. It's very important to choose an XML parser based on the requirements of the app your writing.

With TBXML Pro, I will try to add in some of these features while retaining, or increasing the speed at which TBXML runs.

Watch this space...

12 comments:

  1. A very nice xml parser. Easy to understand, quick implemented and very fast. But with v1.3 its not possible to parse an rss feed... i am waiting for the pro-version.

    ReplyDelete
  2. Hi Marcel,

    Thanks for the great comments! I've just had a go parsing an RSS feed as this should work with TBXML 1.3. However, I ran into a problem where the returned string is not properly decoded.

    The fix was to change all the occurrences of NSUTF8StringEncoding to NSASCIIStringEncoding.

    Once this was done, I was able to parse the following feed without any issues.

    http://www.appleinsider.com/rss/iphone_blog.rss

    This is actually a bug so I will try and fix it ASAP.

    Thanks

    ReplyDelete
  3. Hi Tom,
    do you have a workaround? I have tried to parse a feed but TBXML gets no root-node...
    Thanks in advice

    ReplyDelete
  4. Hi Marcel,

    Try changing all occurrences of NSUTF8StringEncoding to NSASCIIStringEncoding.

    If you still have issues, send me the link and I'll try and figure out what's going wrong.

    Thanks

    ReplyDelete
  5. Hi Tom,
    sorry. It won't work.

    --snip
    TBXML *xml = [[TBXML alloc] initWithURL:[NSURL URLWithString:XML_URL]];
    TBXMLElement *rootXMLElement = xml.rootXMLElement;

    if(rootXMLElement) {


    I cant get the root XML Element....
    I use the same feed as you. (appleinsider.com)

    ReplyDelete
  6. Hi Marcel,

    If you'd like to email me your project, I'll take a look and try and work out whats going wrong. Otherwise, If you'd like to drop me an email, I'll send you the updated TBXML files I'm using in my project.

    You can email me at tom@tbxml.co.uk

    Thanks

    ReplyDelete
  7. Hi Tom,
    you have mail...

    ReplyDelete
  8. Hi,

    TBXML deals with namespace? ie.

    ReplyDelete
  9. Hi Tom,

    you say TBXML is the fastest parser out there. See: http://blog.metaobject.com/2010/05/xml-performance-revisited.html

    MAX appears to be around 2x faster.

    Marcel (different Marcel)

    ReplyDelete
  10. Hi Marcel (different Marcel)

    Thanks for the link! That's some really impressive timings!! I'll check it out properly real soon.

    Cheers

    ReplyDelete
  11. love TBXML...so easy and fast (thats what she said, lol). Thanks for all your hard work!


    T-West

    ReplyDelete
  12. hi
    hiii
    hiiii


    I am having an XML response like this,

    How will be the dictionary o/p when I use dictionaryWithObjectsAndKeys?

    m:properties = { d:pro1 = hi, d:pro1 = hiii, d:pro2 = hiiii}

    or just

    properties = { pro1 = hi, pro1 = hiii, pro2 = hiiii}

    Please help me witha fast reply

    ReplyDelete