how to display data quicker in ASP.net

dilipv

Newcomer
Joined
Feb 21, 2008
Messages
4
hi there,

i am new to this forum can anybody like to suggest , how to display and retive data more quickly.what to use datagrid or datareader, or creating xml file or what else we can do to get quicker.

Any reply is most appreciated.

Thank you
Jitesh
.Net Consulting
 
As a rule data readers will have lower overheads than datasets and can help improve performance.
Other than that you will find tuning the sql itself will often give good performance i.e. only selecting the rows / columns you need, implementing your own paging logic etc. will often give bigger improvements over the simple choice between datareaders / datasets. It may be worth investigating the use of an O/R mapping tool to help streamline the actual data access code you are writing.

As you are using asp.net it is also worth investigating the Cache object and out put caching - both of these can help remove database calls entirely, used sensibly they can be a good performance win.

How are you displaying this information in your front end?
 
hi there,

Let me thank you for giving your valuable suggestion.i displaying data in the datadrid, but is it possible to display data in a simple table.so as to make my application much more quicker. but is this reliable one to do so.

Thank you
Jitesh
Programmer
Sharepoint Consulting
 
Depending on the version of .Net and exactly what you are trying to do will really make a difference here. The data grid in .Net 1 seems to be a lot more bloated than the GridView control in .Net 2 so if you are using .Net 2 try switching.

Rather than creating the table through code though you might want to look at using either the DataList or Repeater control - these will give you more control over the HTML but still have an easy databinding way of doing things.
 
Keep in mind, datareader's increase in speed also means it has reduced functionality, but if you don't need certain features you get from a dataset, then no loss.

As far as speed, fastest to slowest:
1. ram
2. database server (even if it's running on a separate box)
3. xml file

Keep in mind, storing a XML file and reading it into ram is slow that querying the database, because you have to do #3 and then do #1. I once benchmark compared a system I wrote (before .NET) that would read .HTML templates off the harddrive, and when I put the HTML text inside a database table, I could read the database 8x faster than a .HTML file off the HD. Of course 8x faster than microscopic is still microscopic, I didn't use the "template in a database" code because it was seriously more complex to alter a template inside a column vs simply editing a .HTML file on the drive. It would only be an acceptable trade-off when you're dealing with millions of hits (Amazon, eBay).

As a beginner, don't always go the fastest route, keep things good and flexible, don't forget the KISS rule.

Also, if you read into Yahoo's research, only 5% of the total time it takes a webpage to draw is spent on your server code, the other 95% is spent on parsing your HTML/JS/CSS so spend your time outputting great HTML if you want speed improvements. Explaining that is far beyond the scope of this thread.
 
Back
Top