Friday, October 3, 2008

Improving Website Performance - Part 2

Make Use of Repeater control
The ASP.NET controls datagrid, datalist and dataview are heavy on the HTML and doesn't provide scalable performance benefit. Repeater controls provide a better performance over the other ASP.NET controls.

Build the project in Release mode
While building a project make sure to set up the build in release mode. The build in debug mode creates PDB's which overloads the server performance.

Avoid strings and use StringBuilder
The performance of stringbuilder.append is better than string + string. StringBuilder can be a good choice if the concatenation count is more than 3.

Use Server.transfer
server.transfer - sends the request directly to server
response.redirect - sends the response header to client and client in turn sends the request for redirection causing multiple request path.

No comments: