Should I convert XML to JSON for performance reasons?

546 views Asked by At

I am currently storing my settings using the Visual Studio integrated Settings-Management-System, which uses XML. But in this article [http://www.codeproject.com/Articles/159450/fastJSON ] I read that "the fastest XML is ~50x slower than the slowest JSON". So it could be that it would be more perfomant when you convert given XML-Data to JSON and then deserialize it. I did not any find any tests and do not know how I could test it. So would this way be more perfomant and from which amount of data is it (how much) profitable? The JSON-Framework I mean is fastJSON, the probably fastest JSON-Framework in C#.

2

There are 2 answers

0
Pablo Montilla On BEST ANSWER

If you are using the Visual Studio settings, you probably won't notice any difference in performance by using JSON, and will loose the nice GUI and already written support that the settings system affords you. Don't do it!

To verify if you have any speed improvements, you need to get a profiler and measure. Premature optimization is evil!

0
Reza Shirazian On

Optimizing how fast your settings are loaded seems a bit overkill.

If you're continuously loading them all over the place (to the point that making a transition from XML to JSON creates a substantial improvement), you should spend sometime optimizing how you handle your settings.