effective ways to speed up ASP.NET apps?

D

Dave

Hi all,

I was wondering if anyone could point me in the right direction of speeding
up an ASP.Net application.
We converted an old app that ran lightning fast in classic ASP, but now,
(after touting how .Net was going to make things run faster) we have an
application that is unbearably slow (4X slower than the ASP app). Not only
that, it gobbles up a tremendous amount of memory, and makes up to 20
connections to the SQL database at any one time.
I expected the new app to run slower as we had no middle tier before (calls
were made directly to the SQL box and paging was done with stored procedures
instead of ADO), but this is ridiculous. I am relatively new at this, so I
expect to not be as efficient in doing code-behinds and what-not, but most
books I've seen do not have examples at any advanced level and code examples
are too simple to really show how to effectively use resources and run a
speedy app (which is much more important in this case).
Any ideas on this?

TIA
Dave
 
P

Patrice

At first sight it looks like there is a problem with connection handling.
Make sure you close connections when they are no more needed. You could have
also a simailar problem with other objects (keeping a reference to them will
prevent to release them and will consume more and more memory).

Other than that, one of the first step is likely to time a typical page to
find out which section goes so slow...

Patrice
 
K

Kevin Spencer

The guidelines for optimizing ASP.Net apps are the same as the guidelines
for optimizing any other type of application. Perhaps that is why you
haven't seen any specific examples. There isn't any "silver bullet" to
optimization. It's a matter of understanding the technologies more deeply,
and applying the knowledge to your app in such a way as to get the best
performance out of it. It involves both code and architecture
considerations.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
B

Ben de Vette

Dave,

look at the following tool

Red Gate Software
(e-mail address removed)
www.red-gate.com
ANTS Profiler is a code profiling tool designed to profile ASP.NET
applications. ANTS Profiler:

It analyzes your runtime.
Afterwards the tool tells you how many time which method is called and how
long it took in total.

Often you see that some methods take a long time to perform or some methods
are called many times.
So, if you call a method 100 times and it only takes .005 second to perform
(for instance a SQL statement call)
the delay for the page is 5 seconds.

In this way we discovered that using Rowfilter on a DataView took a long
time to perform its work. And because we used it a number of times in a page
the delay was very noticable. When you know where it hurts you can make an
alternitive solution.

So, when you use Ants Profiler you can optimize the bottleneck(s) in stead
opimizing in general.

By the way, fast applications start by analizing the Do's and Dont's.

With kind regards,
Ben
 
D

Dave

Thanks for the input.
The profiler sounds like what I need as I feel I am correctly closing data
connections and so forth. I really need to know why there is a 3-4 second
pause after every mouse click, and why I can see the screen slowly redraw.
It appears my user controls are what could be slowing it down. I would blame
datagrids for a lot (on the admin side where it is no prob) of slow down,
but my index page is slow too!
 
B

bruce barker

most likely you have abused the viewstate size (common with grids). in ie
save your page to disk, and check the size. recode your site to not use
viewstate.

-- bruce (sqlwork.com)
 
C

Coder Coder

You should consider using a .NET profiling tool. This will help you
identify where the bottle necks are in the application.

Definitely check the database code to ensure that connections are
being closed.


http://xpcoder.net
 
J

John Timney \(Microsoft MVP\)

I would agree with what Bruce suggests - use viewstate with care, it puts a
lot of extra traffic across the wire and can bloat an already busy page. If
you aint accepting data turn it off as the browser still has to recieve it
even if you dont use it.

Also, make use of page and kernel caching wherever you can. It can have a
massive performance improvement if ued correctly.
--
Regards

John Timney
Microsoft Regional Director
Microsoft MVP
 
P

Patrice

Looks like you have a server side event on each click ? A possible option is
to process what is doable without two muich problme client side (for example
having some JavaScript that show/hide a part of the page will avoid hitting
the server again to show/hide a section).

A bit strange though that the page needs 3/4 s to refresh itself...

Good luck

Patrice
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top