Search

Showing posts with label Performance and optimization. Show all posts
Showing posts with label Performance and optimization. Show all posts

Sep 16, 2008

Reducing page load times with UpdatePanels and timers

Hi all,

Some time we have requirement like, on single page we are having 5-6 controls, which at the same tiem only single is visible and by navigation we can view all other controls.

This is very specific to Ajax Tab Implementation. Where we are having 4-5 tabs, in which we are having server controls, so on Page load all the controls get loaded and page become heavy also slow.

There is one technique to optimize this. As we all know we have to show single tab once page is get loaded, put all the controls into Asp:Panel and except one which we have to show on default; make other to visible false. The enable of all visible panel will be done using timer control. Time control will make enable the Asp:Panel one by one. As all the Asp:Panel will be in UpdatePanel will page will not get refreshed.

I found the same code in one of the post of Glavs Blog.

He provides the code along with video. Have a look at them and make optimize your page. I used this and found very good, even we can now use this on same page.

Jun 20, 2007

Design Guidelines for Class Library Developers

The .NET Framework's managed environment allows developers to improve their programming model to support a wide range of functionality. The goal of the .NET Framework design guidelines is to encourage consistency and predictability in public APIs while enabling Web and cross-language integration. It is strongly recommended that you follow these design guidelines when developing classes and components that extend the .NET Framework. Inconsistent design adversely affects developer productivity. Development tools and add-ins can turn some of these guidelines into de facto prescriptive rules, and reduce the value of nonconforming components. Nonconforming components will function, but not to their full potential.

These guidelines are intended to help class library designers understand the trade-offs between different solutions. There might be situations where good library design requires that you violate these design guidelines. Such cases should be rare, and it is important that you provide a solid justification for your decision. The section provides naming and usage guidelines for types in the .NET Framework as well as guidelines for implementing common design patterns.

Read more: I have delicious Design Guidelines for Class Library Developers.

Feb 21, 2007

Some hints for developing High-Performance ASP.NET Applications

I observed the following points to be kept in mind while developing application in ASP.NET

· Disable session state when you are not using it.
· Use Page.IsPostBack to avoid performing unnecessary processing on a round trip
· Save server control view state only when necessary
· Do not rely on exceptions in your code [Avoid try, catch block]
· Use the common language runtime's garbage collector and automatic memory management appropriately [try to avoid having objects with Finalize methods] see Automatic Memory Management.
· Use the HttpServerUtility.Transfer method to redirect between pages in the same application
· Use early binding in Visual Basic .NET or JScript code [Include a Strict attribute in the @ Page directive or, for a user control, in the @ Control directive]
· Use SQL Server stored procedures for data access
· Use the SqlDataReader class for a fast forward-only data cursor [SqlDataReader class offers higher performance than the DataSet class]
· Choose the data viewing mechanism appropriate for your page or application [DataGrid Web server control can be a quick and easy way to display data, but it is frequently the most expensive in terms of performance.]
· Cache data and page output whenever possible
· Be sure to disable debug mode
· Enable authentication only for those applications that need it
· Consider disabling AutoEventWireup for your application
· Remove unused modules from the request-processing pipeline

I also have delicious on ASP.NET Performance and optimization

AutoEventWireUp is hitting the performance!!!

Yes its true,

Consider disabling AutoEventWireup for your application.

Setting the AutoEventWireup attribute to false in the Machine.config file means that the page will not match method names to events and hook them up (for example, Page_Load).

If page developers want to use these events, they will need to override the methods in the base class (for example, they will need to override Page.OnLoad for the page load event instead of using a Page_Load method).

If you disable AutoEventWireup, your pages will get a slight performance boost by leaving the event wiring to the page author instead of performing it automatically.