Binary and JSON serializer benchmarks updated

First of all I’d like to offer my sin­cere apolo­gies to those who have asked me to update my bench­mark num­bers fol­low­ing the release of Json.NET 5.0.6, it took me a long time to clear some of my back­logs and only just got around to it, sor­ry for the wait­ing!

The good news is that, based on my tests against a sim­ple POCO object (that’s rep­re­sen­ta­tive of the pay­load that I work with often) Json.NET has deliv­ered on its promised and offered big improve­ments on dese­ri­al­iza­tion per­for­mance and is now neck-to-neck with ServiceStack.Text in terms of dese­ri­al­iza­tion speed.

 

DISCLAIMER : as always, you should be bench­mark against your pay­load and use case, the bench­mark num­bers I have pro­duced here is unlike­ly to be rep­re­sen­ta­tive of your use cas­es and nei­ther is any­body else’s bench­mark num­bers.

You can use the sim­ple test har­ness I cre­at­ed and see this exam­ple code for my JSON seri­al­iz­er tests to bench­mark against your par­tic­u­lar pay­load.

 

JSON

Here is the result against the lat­est ver­sions of JSON seri­al­iz­ers at the time of writ­ing:

image

image

Ver­sions of seri­al­iz­ers test­ed:

 

As men­tioned pre­vi­ous­ly, the lat­est ver­sion of Json.Net has made big improve­ments on its dese­ri­al­iza­tion speed and is now on par with ServiceStack.Text.

 

Binary

image12[1]

image16

Ver­sions of seri­al­iz­ers test­ed:

 

As you can see, there is lit­tle to choose between the usu­al sus­pects of pro­to­buf-net, Mes­sagePack and Mes­sage­Shark, who are well clear of the rest of the pack. I have also includ­ed two addi­tion­al bina­ry seri­al­iz­ers:

  • Flourine­FX, an open source library for work­ing with Flash/Flex remot­ing, and comes with a seri­al­iz­er for AMF encod­ed data
  • Fil­bert, a BERT (Bina­ry ERlang Term) seri­al­iz­er and BERT-RPC client I wrote in F#. As you can see, pure­ly from a per­for­mance point of view it needs much opti­miza­tion on its dese­ri­al­iza­tion speed (specif­i­cal­ly it needs a buffer pool rather than allo­cat­ing new array each time) which I have been hop­ing to find time to do for a while. In gen­er­al, is inter­op­er­abil­i­ty with Erlang some­thing .Net devel­op­ers are inter­est­ed in explor­ing? Would love to hear your thoughts on the mat­ter, and if you know of alter­na­tive approach­es (oth­er than via some­thing like BERT) you think worth invest­ing.

 

Links

My Bench­marks

Sim­ple Speed Tester

Code for the JSON bench­marks

Code for the bina­ry bench­marks