Generate JSON - how to improve performance
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 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.)
- Create a generic list (List)
- 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.
精彩评论