Check out my new course Learn you some Lambda best practice for great good! and learn the best practices for performance, cost, security, resilience, observability and scalability.
Note: Don’t forget to check out Benchmarks page to see the latest round up of binary and JSON serializers.
Follow on from my previous test which showed that the ServiceStack.Text JSON serializer was the top dog in town, I came across a little library called fastJson on codeplex so naturally I had to test it out and see how it compares to the rest!
So using my SimpleSpeedTester and repeating the same test as before I got the following results:
And graphically, this is how they look:
fastJson was the fastest in serialization and ServiceStack.Text was fastest in deserialization but there is very little separating the two libraries in both cases. Given a different data structure to serialize/deserialize you might end up with slightly different results but at the end of the day the two serializers have similar performance characteristics and both are some way ahead of the other JSON serializers I’ve tested.
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:
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.
I specialise in rapidly transitioning teams to serverless and building production-ready services on AWS.
Are you struggling with serverless or need guidance on best practices? Do you want someone to review your architecture and help you avoid costly mistakes down the line? Whatever the case, I’m here to help.
Check out my new podcast Real-World Serverless where I talk with engineers who are building amazing things with serverless technologies and discuss the real-world use cases and challenges they face. If you’re interested in what people are actually doing with serverless and what it’s really like to be working with serverless day-to-day, then this is the podcast for you.
Check out my new course, Learn you some Lambda best practice for great good! In this course, you will learn best practices for working with AWS Lambda in terms of performance, cost, security, scalability, resilience and observability. We will also cover latest features from re:Invent 2019 such as Provisioned Concurrency and Lambda Destinations. Enrol now and start learning!
Check out my video course, Complete Guide to AWS Step Functions. In this course, we’ll cover everything you need to know to use AWS Step Functions service effectively. There is something for everyone from beginners to more advanced users looking for design patterns and best practices. Enrol now and start learning!
Are you working with Serverless and looking for expert training to level-up your skills? Or are you looking for a solid foundation to start from? Look no further, register for my Production-Ready Serverless workshop to learn how to build production-grade Serverless applications!
Here is a complete list of all my posts on serverless and AWS Lambda. In the meantime, here are a few of my most popular blog posts.
- Lambda optimization tip – enable HTTP keep-alive
- You are wrong about serverless and vendor lock-in
- You are thinking about serverless costs all wrong
- Just how expensive is the full AWS SDK?
- Many faced threats to Serverless security
- We can do better than percentile latencies
- Yubl’s road to Serverless
- AWS Lambda – should you have few monolithic functions or many single-purposed functions?
- AWS Lambda – compare coldstart time with different languages, memory and code sizes
- Guys, we’re doing pagination wrong
- Top 10 Serverless framework best practices