How to improve JSON deserialization speed in .Net? (JSON.net or other?)

前端 未结 4 1447
旧巷少年郎
旧巷少年郎 2020-12-12 21:11

We\'re considering replacing (some or many) \'classic\' SOAP XML WCF calls by JSON (WCF or other) calls, because of the lower overhead and ease of use directly in Javascript

4条回答
  •  执笔经年
    2020-12-12 21:48

    var receivedObject = JsonConvert.DeserializeObject(content);
    

    works much faster for me then:

    var receivedObject = JsonConvert.DeserializeObject(content);
    

    and this is even faster:

    dynamic receivedObject = JObject.Parse(content); // The same goes for JArray.Parse()
    

提交回复
热议问题