shailesh
shailesh

Reputation: 5023

Generate JSON - how to improve performance

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 below.)
  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?

Upvotes: 1

Views: 1194

Answers (1)

Frank Schwieterman
Frank Schwieterman

Reputation: 24480

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.

Upvotes: 3

Related Questions