Kodi Community Forum
TinyXML or JsonCpp? - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26)
+---- Forum: PVR (https://forum.kodi.tv/forumdisplay.php?fid=136)
+---- Thread: TinyXML or JsonCpp? (/showthread.php?tid=201500)



TinyXML or JsonCpp? - h.udo - 2014-08-05

Hi,

Working with a backend that provides both APIs, what's the fastest parser, TinyXML or JsonCpp? And from a network traffic point-of-view, what's the most economical?

BR


RE: TinyXML or JsonCpp? - topfs2 - 2014-08-06

Json is less verbose, so less bandwidth intensive. In general atleast, depends greatly on how they are formatting the data in xml.
* http://stackoverflow.com/questions/2673367/how-does-json-compare-to-xml-in-terms-of-file-size-and-serialisation-deserialisa

Parsing wise I don't think there is much difference, probably depends more on the library used than on the schema.
* http://stackoverflow.com/questions/4596465/is-parsing-json-faster-than-parsing-xml

Personally I prefer json as its more readable and you know from the parser what type each property have. I usually pick between the two based on what I need to do, in your case I'd pick the one which you parse and use the easiest. Which is the easiest to map from to our binary API, thats the one I'd pick.


RE: TinyXML or JsonCpp? - h.udo - 2014-08-06

Thanks for the fast response.

Looking at the PVR addons code, TinyXML seems the favourite. Is there a particular reason for this?

BR