开发者

Generate JSON - how to improve performance

开发者 https://www.devze.com 2023-01-07 04:46 出处:网络
Here is what I am doing currently. Get data from database in DataTable (max records would be 100 but stored proc will search against more than 500,000 records. I already took care of search optimiza

Here is what I am doing currently.

  1. Get data from database in DataTable (max records would be 100 but stored proc will search against more than 500,000 records. I already took care of search optimization in database. I am looking how I can improve the performance as much as I can in step# 2 and step# 3 belo开发者_如何学编程w.)
  2. Create a generic list (List)
  3. Use that list and passing it to JavaScriptSerializer to get JSON back.

There are couple more options to generate JSON like DataContractJsonSerializer or JSON.NET or WCF. I wanted to know which options give better performance? Or any other way I can improve the performance?


Here are some perf results from the author of JSON.Net: http://james.newtonking.com/archive/2010/01/01/net-serialization-performance-comparison.aspx. The conclusion would be JSON.Net, if you care to use a third party library.

0

精彩评论

暂无评论...
验证码 换一张
取 消