By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,939 Members | 1,602 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,939 IT Pros & Developers. It's quick & easy.

effective ways to speed up ASP.NET apps?

P: n/a
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
Nov 18 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
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
"Dave" <dave(delete_this)@miraclecatDELETETHISTOO.com> a écrit dans le
message de news:%2***************@TK2MSFTNGP10.phx.gbl...
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

Nov 18 '05 #2

P: n/a
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.

"Dave" <dave(delete_this)@miraclecatDELETETHISTOO.com> wrote in message
news:#i*************@TK2MSFTNGP10.phx.gbl...
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

Nov 18 '05 #3

P: n/a
Dave,

look at the following tool

Red Gate Software
sa***@red-gate.com
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
"Kevin Spencer" <ks******@takempis.com> wrote in message
news:ed**************@TK2MSFTNGP10.phx.gbl...
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.

"Dave" <dave(delete_this)@miraclecatDELETETHISTOO.com> wrote in message
news:#i*************@TK2MSFTNGP10.phx.gbl...
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


Nov 18 '05 #4

P: n/a
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!

"Ben de Vette" <Be****************@profiler.nl> wrote in message
news:10*************@corp.supernews.com...
Dave,

look at the following tool

Red Gate Software
sa***@red-gate.com
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
"Kevin Spencer" <ks******@takempis.com> wrote in message
news:ed**************@TK2MSFTNGP10.phx.gbl...
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.

"Dave" <dave(delete_this)@miraclecatDELETETHISTOO.com> wrote in message
news:#i*************@TK2MSFTNGP10.phx.gbl...
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



Nov 18 '05 #5

P: n/a
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)


"Dave" <dave(delete_this)@miraclecatDELETETHISTOO.com> wrote in message
news:#J**************@tk2msftngp13.phx.gbl...
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!

"Ben de Vette" <Be****************@profiler.nl> wrote in message
news:10*************@corp.supernews.com...
Dave,

look at the following tool

Red Gate Software
sa***@red-gate.com
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
"Kevin Spencer" <ks******@takempis.com> wrote in message
news:ed**************@TK2MSFTNGP10.phx.gbl...
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.

"Dave" <dave(delete_this)@miraclecatDELETETHISTOO.com> wrote in message news:#i*************@TK2MSFTNGP10.phx.gbl...
> 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
>
>



Nov 18 '05 #6

P: n/a
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


"Dave" <dave(delete_this)@miraclecatDELETETHISTOO.com> wrote in message news:<#i*************@TK2MSFTNGP10.phx.gbl>...
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

Nov 18 '05 #7

P: n/a
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
"bruce barker" <no***********@safeco.com> wrote in message
news:uX**************@TK2MSFTNGP10.phx.gbl...
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)


"Dave" <dave(delete_this)@miraclecatDELETETHISTOO.com> wrote in message
news:#J**************@tk2msftngp13.phx.gbl...
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!

"Ben de Vette" <Be****************@profiler.nl> wrote in message
news:10*************@corp.supernews.com...
Dave,

look at the following tool

Red Gate Software
sa***@red-gate.com
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
"Kevin Spencer" <ks******@takempis.com> wrote in message
news:ed**************@TK2MSFTNGP10.phx.gbl...
> 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.
>
> "Dave" <dave(delete_this)@miraclecatDELETETHISTOO.com> wrote in message > news:#i*************@TK2MSFTNGP10.phx.gbl...
> > 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
> >
> >
>
>



Nov 18 '05 #8

P: n/a
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
"Dave" <dave(delete_this)@miraclecatDELETETHISTOO.com> a écrit dans le
message de news:%2****************@tk2msftngp13.phx.gbl...
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!

"Ben de Vette" <Be****************@profiler.nl> wrote in message
news:10*************@corp.supernews.com...
Dave,

look at the following tool

Red Gate Software
sa***@red-gate.com
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
"Kevin Spencer" <ks******@takempis.com> wrote in message
news:ed**************@TK2MSFTNGP10.phx.gbl...
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.

"Dave" <dave(delete_this)@miraclecatDELETETHISTOO.com> wrote in message news:#i*************@TK2MSFTNGP10.phx.gbl...
> 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
>
>



Nov 18 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.