Performance Test — JSON serializers Part II

Note: Don’t for­get to check out Bench­marks page to see the lat­est round up of bina­ry and JSON seri­al­iz­ers.

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 cas­es. Giv­en a dif­fer­ent data struc­ture to serialize/deserialize you might end up with slight­ly 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 oth­er JSON seri­al­iz­ers I’ve test­ed.

Update 2011/11/12:

Fol­low­ing on from request by @ICooper, I’ve includ­ed Jay­Rock in the mix. How­ev­er, as I had trou­ble dese­ri­al­iz­ing (seri­al­iz­ing was fine) the List<int> with Jay­Rock I mod­i­fied the test object slight­ly:


Oth­er­wise, the con­di­tions of the test are as before, and the results are as fol­lows:


And graph­i­cal­ly:


Ser­viceS­tack and fastJ­son still offer by far the best per­for­mance, espe­cial­ly with dese­ri­al­iza­tion, but this time around Ser­viceS­tack proved to be the slight bet­ter of the two, why that’s the case with an int[] instead of a List<int> is beyond me though!

Again, if you’re inter­est­ed in see­ing the test code your­self, you can browse it here on Code­plex.