neuecc / Utf8Json

Definitely Fastest and Zero Allocation JSON Serializer for C#(NET, .NET Core, Unity, Xamarin).
MIT License
2.36k stars 267 forks source link

Is this a production ready? And what are the things to consider when Migrating from migration from newtonsoft #212

Open penguinawesome opened 4 years ago

penguinawesome commented 4 years ago

Hello,

We are planning to change our json serializer / deserializer

Is this a production ready? And what are the things to consider when Migrating from newtonsoft JSON.net? Thanks :)

karakal commented 4 years ago

We just migrated a project from JSON.net to Utf8Json. It is definitely production ready, especially with the performance on smaller devices (EdgePC in association with Azure IOT Edge). If you are serializing/deserializing full objects you can use it nearly as a drop-in-replacement. We just added Serializing into a Stream for better performance. When you are using dynamic serializing it is as simple as that:

JSON.net: JObject json = JObject.Parse (messageString); UTF8Json: var json = JsonSerializer.Deserialize(messageString);

All the other code like accessing the value of nodes like json["info"] can stay the same.

n8allan commented 4 years ago

As much as I want to, I cannot honestly recommend it for production. There are some pretty critical encoding/decoding bugs with easy fixes already sitting in PR, but the author seems to have abandoned this project. If you happen to not run into one of those bugs, then great, but I have run into an issue before. I wish the author would either officially abandon this, or hand it over to someone else, because there is much here to love.

penguinawesome commented 4 years ago

@n8allan thanks for your insights. What are those bugs or issues you have encountered so far?