XML Found To Be Just As Fast As JSON

Since its introduction in 1996, XML has taken the area by storm by providing a very easy to make use of markup language that’s utilized in everything from RSS to office productivity software. Its main competitor – JSON – is usually quoted as being superior thanks to it being faster while using less bandwidth. One engineer has set to prove that inaccurate.

David Lee, lead engineer at MarkLogic, has published a paper called “Fat Markup: Trimming the parable One Calorie At A Time.” The paper documents an experiment where he pit XML against JSON in almost 1,200 tests covering 33 different documents across multiple Web browsers and operating systems. The outcomes may surprise you.

Upon the realization of the experiment, Lee had found four areas that show XML and JSON are both slaves to outside influences. The 1st conclusion found that the parsing speed changes looking on which parsing technique is used with XML performing better with pure JavaScript while JSON performs betters with query speed. The second one conclusion found that jQuery slows down both markup languages, but XML sees an even bigger dip in performance. The third conclusion found that compressed documents, even with format, are an identical size across both markup languages. The general conclusion found that transfer speed is basically an identical across both markup languages.

So, what does this all mean? The needless fighting over which markup language is best doesn’t make the internet an easier place. Lee instead recommends that developers specialize in making their Internet sites more efficient in order that both XML and JSON can perform at their best. For that reason, he recommends using HTTP Compression and markup optimization. He does provide one caveat though. Developers shouldn’t try and optimize unless there’s a major problem with data transmission on their Website.

[Image: Dreftymac/WikiMediaCommons]
[h/t: InfoQ]