Hello All,
This is turning out to be a great thread on performance in general – thanks to everyone contributing. My take on this is that Webforms (ASP.NET) will always be slower in general than desktops, especially on IE – DHTML / Javascript is a completely different platform and has its pros and cons.
As far as grids in particular are concerned, here is what I can suggest:
0. Check out the help documentation for performance tips:
http://help.infragistics.com/Help/NetAdvantage/NET/2008.2/CLR2.0/html/WebGrid_Performance.html
1. Use profiling tools to see where the problems is. Sometimes the problem can be at the datasource layer (slow SQL query). Sometimes it can be server-side processing (the C# server-side code). Sometimes it can be slow loading time (maybe – a lot of HTML generated). Sometimes it is the browser itself that is sluggish (client-side / javascript problems). Knowing where the bottleneck is makes things much easier.
2. Use server side data caching. That is, never execute a complex and time consuming SQL query twice – store the result (for example DataTable in the application Cache and then retrieve from there on rebind).
3. Use ASP.NET Page Caching. That is the OutputCache directive. ASP.NET has a great great caching infrastructure built-in – through OutputCache you can customize caching in many ways (and invalidate cache when needed when data changes with Sql Dependencies, or through time dependency, etc)
4. Play with ViewState. Sometimes in some scenarios it is possible to turn ViewState off (EnableViewState = false) and then rebind from cache in each postback to server. ViewState off will reduce the HTML size signifficantly.
5. Script combining may also work fine (it was already suggested by a customer here, check out Tony Lombardo's post on our forums)
6. Install a ZIP add-on for IIS. There are many ZIP compression Add-Ons for IIS. ZIP compressors typically zip the IIS response and browsers decompress it on the client – this may speed things up a LOT. Just make sure you are using popular ones and test before deployment. I've seen page load times go up 5-6 times just because of that.
7. Use Paging – either built-in or custom – it is unlikely that your end-users need more than 20-30 rows at a time, so PageSize > 20 will just make the requests slower whie not helping end-users a lot.
8. Use Load On Demand / AJAX. The grid has at least 4 different modes of that (Virtual Scrolling, AJAX, LoadOnDemand) – check out the samples and help for that – fetch only the data you need to display and load the rest when user interaction occurs.
9. Change the interface. I am not sure many end-users will be able to cope with 80 columns and 400 rows at once. I myself find it difficult to even read more than 5 columns and 20 rows at a time (this is 100 cells with data). You can show the rest of the rows with paging and / or AJAX, while for the columns – you can show them on row click in a different window, HTML placeholder, or even in our great WebDialogWindow component.
HTH, and keep the feedback coming – great stuff.