Long Page Load -- Lots of Data -- A problem

  • Thread starter Thread starter Harry Whitehouse
  • Start date Start date
H

Harry Whitehouse

Hi!

Today I coded a small ASPNET page which accepts a 5 digit ZIP code and will
return all the street names in that ZIP code. You can try it out here:

http://65.203.54.72/FindAddress/FindAddress.aspx

The server side reads a special USPS database and creates a Dataview which
in turn is bound to a datagrid.

I've found one problem thusfar. If you put in a very urban ZIP code
(10016 -- NYC) and no street name, the query takes about 30 seconds to
render -- but it does come up eventually. There are about 11,100 entires in
the grid - which is likely a worst-case. If you then input another ZIP
(try your own) and press Go again, one immediately gets a "page not found"
screen.

If you push the refresh button on the brower and try again with the new ZIP,
it will work OK.

Similarly, if you don't look up a "stressful query", you can examine any
number of ZIP's in succession without a problem.

I'm wondering what's going on. Granted, the data download for 11,000
entries is pretty substantial. Is there some sort of connection timeout
that I'm encountering? Is there a setting in the CONFIG file that I need
to tweak?

I'm running IIS5 and .NET 2003. My browser is IE 6 with all the updates.

Any thoughts would be appreciated!

TIA

Harry
 
Hi Harry,

It's not a good idea to use a DataSet for large numbers of records because
it builds a memory based structure. First the structure gets built, then the
DataView performs some analysis to get the sorted view - all very slow on
even a few thousand records. You might want to consider using a DataReader
and pull the data in the right order out of the database.

Finally you say you have a grid with 11,000 items? Who's going to actually
read all of this data? You really need to think about presenting this
differently. Most of the slowness problem is likely the browser trying to
render 11,000 columns.

I'd do some testing to see where the slowness is - in the retrieval or in
the rendering and then address that particular problem. With what you say I
bet the bulk of the problem is in the rendering in the browser.


+++ Rick ---

--

Rick Strahl
West Wind Technologies
www.west-wind.com
www.west-wind.com/weblog
 
When I tried your page and "view source" during the process, I see the page
is actually transferring and there is overhelming of viewstate data in it.
Consider disabling viewstate for the grid can do some help. (Probably
there's much time spent on encoding the viewstate, add trace="true" to your
"page" tag to see the time and size spent on it)
 
Back
Top