Tuesday, August 20, 2013

Faster JSON serialization with ServiceStack.Text

I've been using JSON.Net to serialize objects to and from JSON for years.

However, ever since I heard that ServiceStack had a faster JSON serializer I've wanted to try it.
After all, speed is important, especially on a mobile devices, and if I can make my code run faster by just swapping out one third party library for another then that's a simple decision.


Today I finally got around to trying it and to do so I built a console app so I could put the two methods side by side.


Look both methods are very similar. And as I rarely do anything more complicated with JSON than just serialize or deserialize this is great.

Obviously the above isn't enough for me to prove that it's faster. I'm just trusting the benchmark testing done by others.

It's also a smaller DLL so it will reduce the overall XAP size and download time. Plus app load time too. :)



My only slight reservation is that ServiceStack doesn't give me the debugging assistance I get with Json.Net. Maybe I'll look to just use Json.Net in the debug build if this becomes an issue.

3 comments:

  1. You know your projects stand out of the herd. There is something special about them. It seems to me all of them are really brilliant!

    ReplyDelete
  2. Thanks for the such a wonderful post and great coding. I love it very much

    ReplyDelete

I get a lot of comment spam :( - moderation may take a while.