I am looking for general optimization tips and guidelines for xml parsing.

One of the optimization strategies is of course selecting the "right" parser. A detailed comparison between the available parsers for ios can be found here http://www.raywenderlich.com/553/how-to-chose-the-best-xml-parser-for-your-iphone-project.

However, I am currently trying to investigate general guidelines and tips on how to optimize by payloads to increase the performance as possible.

This question is similar to (a question I have posted in the context of ios) but I have not got a sufficient answer. So this question is not in the context of any particular programming language.

  • 1
    Is your XML doc structure fixed, or do you have some freedom to change it? How big are they, and how many files you have to process? Do you must process them sequentially or one-by-one? What are your performance expectations, and what performance do you have today? If you want to get useful answers about performance, you should provide such details. – Doc Brown Jun 13 '12 at 17:50

Firstly, do you need to use XML? Or can you go with the more compact JSON format?

Another design principle is that you often don't need to send an entire document, just a snippet - you want to do as little serialising/de-serialising as possible.

If you're really looking into this in depth you can start investigating things like the shape/size of network packets and aligning your data to that etc.

  • I am actually bound to using xml in this particular case. I am not sure if json is always better in performance (edwardawebb.com/tips/xml-json). – Future2020 Jun 13 '12 at 10:43
  • It's certainly not always better no, "Measure, don't guess" is the mantra to follow here. – Martijn Verburg Jun 14 '12 at 9:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.