Introduction
Performance has been a concern of ours throughout this book, and we have endeavored to provide you with production-ready code that will perform well in any setting. And when a recipe involves trade-offs between performance and ease of implementation, we strive to bring these to your attention. Nevertheless, when an application is not performing as well as you would like, you can improve matters by altering its handling of the following elements:
-
ViewState
You can often improve a pageâs performance by disabling the
ViewState
for the page or some of its controls, but you have to be aware of the consequences.- String concatenation
Youâve probably heard that it is better to use the
StringBuilder
object to build strings rather than the classic concatenation operators (& and +). But you may be wondering how much better it is and if it applies to your situation.- Data access
With the different options available for data access, ways to improve data access performance exist, especially when choosing between the two primary methods for reading data from a databaseâi.e., via a
DataReader
or aDataAdapter
.- SQL Server managed provider
For the sake of database interoperability, the bulk of the recipes in this book show how to access data using the
OleDB
managed provider. Yet because of the performance that can be garnered, much can be said for using the SQL Server managed provider instead when you know the application will always access SQL Server 7.0 or later.
All of these topics ...
Get ASP.NET 2.0 Cookbook, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.