Is parsing JSON faster than parsing XML

前端 未结 11 756
盖世英雄少女心
盖世英雄少女心 2020-12-01 04:51

I\'m creating a sophisticated JavaScript library for working with my company\'s server side framework.

The server side framework encodes its data to a simple XML for

11条回答
  •  广开言路
    2020-12-01 05:36

    Firstly, I'd like to say thanks to everyone who's answered my question. I REALLY appreciate all of your responses.

    In regards to this question, I've conducted some further research by running some benchmarks. The parsing happens in the browser. IE 8 is the only browser that doesn't have a native JSON parser. The XML is the same data as the JSON version.

    Chrome (version 8.0.552.224), JSON: 92ms, XML: 90ms

    Firefox (version 3.6.13), JSON: 65ms, XML: 129ms

    IE (version 8.0.6001.18702), JSON: 172ms, XML: 125ms

    Interestingly, Chrome seems to have almost the same speed. Please note, this is parsing a lot of data. With little snippets of data, this isn't probably such a big deal.

提交回复
热议问题