Valeh Mikayilzadeh
Valeh Mikayilzadeh

Reputation: 919

Which is better to use for serialization objects? JsonSerializer or JsonConvert

I want to serialize object in c# and learn that we can do this both JsonSerializer and JsonConvert. I know about documentation knowledges about these.

But I want to know which is better to use for serialization objects? JsonSerializer or JsonConvert?

Upvotes: 6

Views: 10175

Answers (2)

Bahman Pourgholami
Bahman Pourgholami

Reputation: 23

"JsonConvert" is good for Small Project but for more than 4000 request and big Project with massiv Data, become "Memory out of exception" Error!!

then you have to use "JsonSerializer "

Upvotes: -3

Nawaaz Soogund
Nawaaz Soogund

Reputation: 129

JsonConvert from JSON.net is reportedly better for performance. I actually use it myself and find it very easy to use and works well with attributes in classes. In terms of memory usages it was good for us. The application I work is able to handle around 3500 to 4000 requests including 3 deserialization, 2 http service calls to retrieve data and, one serialization and one service call to push data.. So, in terms of performance it was a great choice.

http://www.newtonsoft.com/json/help/html/performance.htm (I know, a bit biased, but still) nuget: https://www.nuget.org/packages/newtonsoft.json/

Upvotes: 4

Related Questions