Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP page load times

Status
Not open for further replies.

Simpleton

Programmer
Jul 31, 2002
27
GB
I have page that has a table the rows of the table are built from a recordset. The number of rows in the recordset can vary from 0 to a few hundred. Anything below 50 rows seems to load fairly quickly, the test query I am using that returns a little over 250 rows will take about 1.3 seconds to generate the data in the server and 50ish seconds to build the page.

I have tried using

<% while not rs.eof %>
<TR>Table columns from recordset, blah</TR>
<% rs.movenext
wend %>

and

<%
dim sOutput
while not rs.eof
soutput = &quot;<TR>&quot; & Table columns from recordset, blah &&quot;</TR>&quot;
rs.movenext
wend
Response.write soutput %>

neither of which appear to be much faster than the other.

Is there a better way to do this and speed up the browser display stime, there are about 5 columns across the page for each row, of which about 18 rows are displayed in the frame before they become hidden and scroll off the bottom.

Quite puzzled as to why the browser struggles to display the small amount of data. I know one answer would be to page it, but the users would really prefer just to scroll down the entire list of entries in one hit.

Thanks for any help to save my hair.
 
I have managed to find a way to get the initial display of the page to be almost immediate.

<script Language=&quot;Jscript&quot;>
function setupPage() {
divLOADING.style.display = 'none';
TBLaggDetail.style.visibility = '';
return;
}
</script>
</head>
<body onload=&quot;setupPage();&quot; class=&quot;TR1&quot; topMargin=&quot;0&quot; leftMargin=&quot;0&quot; rightMargin=&quot;0&quot; bottomMargin=&quot;0&quot;>
<DIV Width=&quot;100%&quot; id=&quot;divLOADING&quot; name=&quot;divLOADING&quot;>Loading page....please wait...
</DIV>
<table ID=&quot;TBLaggDetail&quot; NAME=&quot;TBLaggDetail&quot; cellspacing=&quot;1&quot; cellpadding=&quot;2&quot; border=&quot;0&quot; class=&quot;framedtable&quot; width=&quot;100%&quot; style=&quot;visibility: hidden&quot;>
Table guts
</Table>
</Body>

Problem now is, although the window displays fairly quickly, about 4 seconds it locks up for 50 seconds still while the browser does something with the rest of it?

Stumped :(
 
what database are you using?

what about:

maybe use &quot;getrows&quot; and see if working with an array is faster.

maybe make several sql calls so that the results get returned seperatly and write each recordset to the screen. This will have all the records on the same page, but it could (seem to) show them faster since it will pause and show @50 then pause then show another 50.... I have never tried something like this, but it seems like it could work.

Kris
 
Will certainly look into it however I believe the problem is the browser (ie 5.5sp2) rendering or at least allocating resources for the page. It pages up 80mb of memory but the html stream isn't that massive 338kb for the whole page.

I am going to look into the getrows method and also another technique of doing things like

Select &quot;<TD clas=???>&quot; + Field + &quot;</TD>&quot; from table where x = ?

in the query and just output the fields.
 
Try also to set your Response.Buffer = False at the top of the ASP page, this will cause the server to send the data as it resolves it rather than fill the buffer until the entire script has been executed.

-Tarwn --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
Can't...think...of...anything...funny...to.........say............
need.....coffee....................
 
heh tried that already and on the local machine is fine and a little faster, on a remote machine the page stops loading for no reason, view source and the server spits out some little message about buffering must be on :(

Sigh

Thanks for all the suggestions so far.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top