Yan Cui
I help clients go faster for less using serverless technologies.
I recently reorganized the SimpleSpeedTester project’s structure so that it’s easier to add tests to both the Json and binary serializer benchmarks, and to run the tests is as easy as running the RunBenchmarks.fsx F# script and then choosing which benchmark you’d like to run and then kick back and wait for the results to come back.
DISCLAIMER : as always, you should be benchmark against your payload and use case, the benchmark numbers I have produced here is unlikely to be representative of your use cases and neither is anybody else’s benchmark numbers.
You can use the simple test harness I created and see this example code for my JSON serializer tests to benchmark against your particular payload.
Binary Serializers
Versions tested:
- Filbert v0.2.0
- FluorineFx v1.2.4
- MsgPack v0.1.0.2011042300
- Json.Net v5.0.8
- protobuf-net v2.0.0.668
- MessageShark
JSON Serializers
System.Json has been added to the list of serializers thanks to Mauricio’s pull-request.
P.S. protobuf-net is NOT a JSON serializer, but it’s in the mix here simply as a benchmark since it’s one of the more widely used and fastest serializers around, and useful to compare the BSON serializers in the list.
Versions tested:
- Json.Net v5.0.8
- fastJson v2.0.27.1
- MongoDB Driver v1.8.3
- SimpleJson
- System.Json (beta) 4.0.20126.16343
- JsonFx v2.0.1209.2802
- JayRock v0.9.16530
Since I started doing these benchmarks more than two years ago, I have been impressed by the way Json.Net upped its game since those early benchmarks! Long may the healthy competition lasts between these JSON serializer heavyweights so that rest of us can simply reap the benefits of the great work guys like Demis Bellot and James Newton-King are doing in providing essential tooling in this space!
Whenever you’re ready, here are 3 ways I can help you:
- Production-Ready Serverless: Join 20+ AWS Heroes & Community Builders and 1000+ other students in levelling up your serverless game. This is your one-stop shop for quickly levelling up your serverless skills.
- I help clients launch product ideas, improve their development processes and upskill their teams. If you’d like to work together, then let’s get in touch.
- Join my community on Discord, ask questions, and join the discussion on all things AWS and Serverless.
Pingback: F# Weekly #5, 2014 | Sergey Tihon's Blog
Can FsPickler be added?
@David – sure, I’ll add it to the binary serializers test, been on my list for a while just haven’t got around to it.
That would be great thank you, will all come in handy soon.
Would be interesting to compare with OCaml. Last I looked, OCaml was orders of magnitude faster than .NET at serialization.
@Jon – I’ve not looked at OCaml at all, what is it about OCaml that makes serialization so much faster?
Is the order of magnitude difference you mentioned specifically referring to the built-in serializers in OCaml vs .Net? Some of the open source serializers in .Net are doing a really good job of beating the BCL serializers.