Note: Don’t forget to check out Benchmarks page to see the latest round up of binary and JSON serializers.

Fol­low on from my pre­vi­ous test which showed that the ServiceStack.Text JSON seri­al­izer was the top dog in town, I came across a lit­tle library called fastJ­son on code­plex so nat­u­rally I had to test it out and see how it com­pares to the rest!

So using my Sim­ple­SpeedTester and repeat­ing the same test as before I got the fol­low­ing results:

And graph­i­cally, this is how they look:

fastJ­son was the fastest in seri­al­iza­tion and ServiceStack.Text was fastest in dese­ri­al­iza­tion but there is very lit­tle sep­a­rat­ing the two libraries in both cases. Given a dif­fer­ent data struc­ture to serialize/deserialize you might end up with slightly dif­fer­ent results but at the end of the day the two seri­al­iz­ers have sim­i­lar per­for­mance char­ac­ter­is­tics and both are some way ahead of the other JSON seri­al­iz­ers I’ve tested.

Update 2011/11/12:

Following on from request by @ICooper, I’ve included JayRock in the mix. However, as I had trouble deserializing (serializing was fine) the List<int> with JayRock I modified the test object slightly:

Otherwise, the conditions of the test are as before, and the results are as follows:

And graphically:

ServiceStack and fastJson still offer by far the best performance, especially with deserialization, but this time around ServiceStack proved to be the slight better of the two, why that’s the case with an int[] instead of a List<int> is beyond me though!

Again, if you’re interested in seeing the test code yourself, you can browse it here on Codeplex.

You might also like

Have you had a chance to play with the new System.Json serializer? It is part of the WCF Futures project http://wcf.codeplex.com/. If you download Preview 5, it is in there. This is also a current version of System.Json, but it is only installed as part of Silverlight, and is different than the new one.

theburningmonk

Don – not yet, I’ll give it a go tonight and include in my test and update the post with the result :-)

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.