473,495 Members | 1,967 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Speed of response of an asp.net 2.0 web form

Hi Folks,

I have an asp.net 2.0 web page with about 3-4 gridview controls on it.
Each of the gridview controls is bound to a SqlDataSource which calls a
stored procedure. The number of records being fetched by the stored
procedure are not more than 10 as they are being filtered by the
parametrized stored procedure on the database. So the amount of data
being sent back and forth from the client and the server is not
significant. The slowest stored procedure of them takes about 6 s to
run. However, when I run the web page, it takes about 45 s to load
which is unacceptable. I don't need to maintain viewstate and session
state, so I have disabled it. I have used buffering in the pages.

When I run a trace, I find that max amount of time is spent between the
Begin PreRender and End PreRender events as shown below
Trace Information
Category Message From First(s) From Last(s)
aspx.page Begin PreInit
aspx.page End PreInit 0.000442793707021423 0.000443
aspx.page Begin Init 0.000483301648673225 0.000041
aspx.page End Init 0.000588622296967911 0.000105
aspx.page Begin InitComplete 0.000617676268911272 0.000029
aspx.page End InitComplete 0.000644495319935914 0.000027
aspx.page Begin PreLoad 0.000670196910501195 0.000026
aspx.page End PreLoad 0.000729701679962118 0.000060
aspx.page Begin Load 0.00075791755656096 0.000028
aspx.page End Load 0.954709886312367 0.953952
aspx.page Begin LoadComplete 0.954773302193435 0.000063
aspx.page End LoadComplete 0.954820794262958 0.000047
aspx.page Begin PreRender 0.954848172044212 0.000027
aspx.page End PreRender 45.0125610936586 44.057713
aspx.page Begin PreRenderComplete 45.012613334935 0.000052
aspx.page End PreRenderComplete 45.0126435063674 0.000030
aspx.page Begin SaveState 45.0168957227804 0.004252
aspx.page End SaveState 45.0170401545448 0.000144
aspx.page Begin SaveStateComplete 45.0170731196283 0.000033
aspx.page End SaveStateComplete 45.0170996593142 0.000027
aspx.page Begin Render 45.0171261990002 0.000027
aspx.page End Render 45.0217010821208 0.004575
Any ideas as to what I might be doing wrong here? Any suggestions to
improve the speed of the web page ?

Thanks

Hemil.

Aug 15 '06 #1
2 1705
First, don't mess around with buffering, it most likely will buy you nothing.
You have only posted timings but no code so we can only guess what is gong on.
If the data doesn't change for the Gridviews, you can load it once and cache
the datasets / datatables. In this manner the second time the page is
requested all the data will already be there in memory.
But again, getting reasonable amounts of data from a db and binding it to a
control should not take long at all, even if you have six of them.
So, you need to go back and study your code for best-practices patterns.
Make sure all your connections are closed as soon as their work is done.

Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"he************@gmail.com" wrote:
Hi Folks,

I have an asp.net 2.0 web page with about 3-4 gridview controls on it.
Each of the gridview controls is bound to a SqlDataSource which calls a
stored procedure. The number of records being fetched by the stored
procedure are not more than 10 as they are being filtered by the
parametrized stored procedure on the database. So the amount of data
being sent back and forth from the client and the server is not
significant. The slowest stored procedure of them takes about 6 s to
run. However, when I run the web page, it takes about 45 s to load
which is unacceptable. I don't need to maintain viewstate and session
state, so I have disabled it. I have used buffering in the pages.

When I run a trace, I find that max amount of time is spent between the
Begin PreRender and End PreRender events as shown below
Trace Information
Category Message From First(s) From Last(s)
aspx.page Begin PreInit
aspx.page End PreInit 0.000442793707021423 0.000443
aspx.page Begin Init 0.000483301648673225 0.000041
aspx.page End Init 0.000588622296967911 0.000105
aspx.page Begin InitComplete 0.000617676268911272 0.000029
aspx.page End InitComplete 0.000644495319935914 0.000027
aspx.page Begin PreLoad 0.000670196910501195 0.000026
aspx.page End PreLoad 0.000729701679962118 0.000060
aspx.page Begin Load 0.00075791755656096 0.000028
aspx.page End Load 0.954709886312367 0.953952
aspx.page Begin LoadComplete 0.954773302193435 0.000063
aspx.page End LoadComplete 0.954820794262958 0.000047
aspx.page Begin PreRender 0.954848172044212 0.000027
aspx.page End PreRender 45.0125610936586 44.057713
aspx.page Begin PreRenderComplete 45.012613334935 0.000052
aspx.page End PreRenderComplete 45.0126435063674 0.000030
aspx.page Begin SaveState 45.0168957227804 0.004252
aspx.page End SaveState 45.0170401545448 0.000144
aspx.page Begin SaveStateComplete 45.0170731196283 0.000033
aspx.page End SaveStateComplete 45.0170996593142 0.000027
aspx.page Begin Render 45.0171261990002 0.000027
aspx.page End Render 45.0217010821208 0.004575
Any ideas as to what I might be doing wrong here? Any suggestions to
improve the speed of the web page ?

Thanks

Hemil.

Aug 16 '06 #2
Hi Peter,

There is no code in the code in the codebehind file. The data binding
is in the aspx file.

Sample code for one of the gridview controls pasted below:

<asp:GridView ID="GridViewPersonDetails" runat="server"
AutoGenerateColumns="False"
DataSourceID="SqlDataSourcePersonDetails"
EmptyDataText="No Data" EnableViewState="False" >
<Columns>
<asp:BoundField DataField="Customer ID"
HeaderText="Customer ID" SortExpression="Customer ID" />
<asp:BoundField DataField="Surname"
HeaderText="Surname" SortExpression="Surname" />
<asp:BoundField DataField="Given Names"
HeaderText="Given Names" SortExpression="Given Names" />
<asp:BoundField DataField="Address"
HeaderText="Address" SortExpression="Address" />
<asp:BoundField DataField="Home Phone"
HeaderText="Home Phone" SortExpression="Home Phone" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSourcePersonDetails"
runat="server" ConnectionString="<%$ ConnectionStrings:Connection
String %>"
SelectCommand="rpt_PersonDetails"
SelectCommandType="StoredProcedure" EnableViewState="False"
EnableCaching="True">
<SelectParameters>
<asp:QueryStringParameter Name="PersonID"
QueryStringField="id" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>

Thanks
Hemil.

Peter wrote:
First, don't mess around with buffering, it most likely will buy you nothing.
You have only posted timings but no code so we can only guess what is gong on.
If the data doesn't change for the Gridviews, you can load it once and cache
the datasets / datatables. In this manner the second time the page is
requested all the data will already be there in memory.
But again, getting reasonable amounts of data from a db and binding it to a
control should not take long at all, even if you have six of them.
So, you need to go back and study your code for best-practices patterns.
Make sure all your connections are closed as soon as their work is done.

Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"he************@gmail.com" wrote:
Hi Folks,

I have an asp.net 2.0 web page with about 3-4 gridview controls on it.
Each of the gridview controls is bound to a SqlDataSource which calls a
stored procedure. The number of records being fetched by the stored
procedure are not more than 10 as they are being filtered by the
parametrized stored procedure on the database. So the amount of data
being sent back and forth from the client and the server is not
significant. The slowest stored procedure of them takes about 6 s to
run. However, when I run the web page, it takes about 45 s to load
which is unacceptable. I don't need to maintain viewstate and session
state, so I have disabled it. I have used buffering in the pages.

When I run a trace, I find that max amount of time is spent between the
Begin PreRender and End PreRender events as shown below
Trace Information
Category Message From First(s) From Last(s)
aspx.page Begin PreInit
aspx.page End PreInit 0.000442793707021423 0.000443
aspx.page Begin Init 0.000483301648673225 0.000041
aspx.page End Init 0.000588622296967911 0.000105
aspx.page Begin InitComplete 0.000617676268911272 0.000029
aspx.page End InitComplete 0.000644495319935914 0.000027
aspx.page Begin PreLoad 0.000670196910501195 0.000026
aspx.page End PreLoad 0.000729701679962118 0.000060
aspx.page Begin Load 0.00075791755656096 0.000028
aspx.page End Load 0.954709886312367 0.953952
aspx.page Begin LoadComplete 0.954773302193435 0.000063
aspx.page End LoadComplete 0.954820794262958 0.000047
aspx.page Begin PreRender 0.954848172044212 0.000027
aspx.page End PreRender 45.0125610936586 44.057713
aspx.page Begin PreRenderComplete 45.012613334935 0.000052
aspx.page End PreRenderComplete 45.0126435063674 0.000030
aspx.page Begin SaveState 45.0168957227804 0.004252
aspx.page End SaveState 45.0170401545448 0.000144
aspx.page Begin SaveStateComplete 45.0170731196283 0.000033
aspx.page End SaveStateComplete 45.0170996593142 0.000027
aspx.page Begin Render 45.0171261990002 0.000027
aspx.page End Render 45.0217010821208 0.004575
Any ideas as to what I might be doing wrong here? Any suggestions to
improve the speed of the web page ?

Thanks

Hemil.
Aug 16 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
3985
by: Shailesh Humbad | last post by:
I just posted an article I wrote called ASP Speed Tricks. It covers techniques to optimize output of database data in HTML, for both simple tables and complex tables. More advanced ASP authors...
12
2028
by: MikeT | last post by:
I have a page that produces little thumbnails of the 3D models it finds in a specified directory (and iterates down through any sub directories). It basically scans each directory for 3D Studio...
8
4245
by: ken | last post by:
Hi, I'm trying to speed up the loading of my forms. One problem that I have(probably) is that I have many subforms in the form that I'm trying to speed up. I can't change that now, but I will...
4
2891
by: hamil | last post by:
I wrote a VB.net "echo" program using the Tcp client/listener class to determine how fast the transactions would occur. I got a speed of about 160 echoes per second. A friend did the same test...
3
5016
by: Mike Kelly | last post by:
Hi. I've built a page using standard ASP.NET 2.0 features and when I upload a large file (>20MB) to our intranet server, I get a paltry 100KB/s on our 100Mb/s LAN. Simply copying the file, I get...
13
2467
by: BK | last post by:
Our .Net team has just inherited a junior programmer that we need to get up to speed as quickly as possible. Unfortunately, his skill set is largely Access with some VB6 and ASP classic...
2
2724
by: jphelan | last post by:
Ever since I successfully applied some techniques for increasing the speed of my 17 meg. Application; it has only made me hunger for more. First, let me list what I have done so far: 1. Split...
1
1414
by: korggrok | last post by:
OK, this makes no sense to me, perhaps someone understands what's happening. Developing a CGI app. A page contains a table with <th> header elements and <tdtable elements, both if which contain...
1
2110
by: Mecena | last post by:
Hi all! I have a problem regarding form loading speed. I have forms with many controls and some time ago I've implemented a fader that uses a symbollic millisecond of fade time to buffer the...
3
1435
by: John | last post by:
Hi I have a multi-form winform database application. The client keeps complaining that application runs too slow 50% of the time. The problem seems to be in two areas; a) app is slow...
0
6991
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7160
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7196
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6878
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5456
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1405
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
649
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
286
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.