473,471 Members | 4,616 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Q about ASP speeds

I just converted lots of ASP to ASP.NET (using ASP2ASPX) and noticed a
drop in rendering speed. For example, one ASP page takes 0.0313s to be
generated while the ASP.NET version takes 0.4842s. Granted they are
both fast but the ASP speeds makes me think ASP object caching is
better/faster (as the SQL is the exactly the same)

Either that or I don't have something setup correctly (yet). ASP
pages use:

Response.Expires = -1
Response.ExpiresAbsolute = strDatabaseTime - 2
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "No-Store"

for caching while the ASP.NET pages use:

Response.Expires = CInt(- 1)
Response.AddHeader("pragma", "no-cache")
Response.AddHeader("cache-control", "private")

So both should be re-rendered every hit. Do you have any suggestions
where I could start looking or good tools for profiling the diffs?

Thank you,
Michael

Sep 6 '06 #1
4 1262
Have you tried disabling the ViewState? If you're converting from
traditional ASP to ASP.NET then its highly unlikely that you have any
need for the ViewState.
I *never* enable ViewState unless absolutely necessary (usually due to
3rd party controls).

Add the following setting to your page heading on the client side or
set it using the properties for the page:

EnableViewState="False"

m

mp****@htxml.com wrote:
I just converted lots of ASP to ASP.NET (using ASP2ASPX) and noticed a
drop in rendering speed. For example, one ASP page takes 0.0313s to be
generated while the ASP.NET version takes 0.4842s. Granted they are
both fast but the ASP speeds makes me think ASP object caching is
better/faster (as the SQL is the exactly the same)

Either that or I don't have something setup correctly (yet). ASP
pages use:

Response.Expires = -1
Response.ExpiresAbsolute = strDatabaseTime - 2
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "No-Store"

for caching while the ASP.NET pages use:

Response.Expires = CInt(- 1)
Response.AddHeader("pragma", "no-cache")
Response.AddHeader("cache-control", "private")

So both should be re-rendered every hit. Do you have any suggestions
where I could start looking or good tools for profiling the diffs?

Thank you,
Michael
Sep 6 '06 #2
There is no question that ASP.NET pages have the capabilities to render and
process MUCH faster than "Classic ASP" page BUT these performance
improvements do not come out of the box, you must understand several ASP.NET
topics and use them in conjunction with each other to get maximum
performance. Here are a few topics to look into:

1. All the server-side code you write in .NET is compiled code vs. the
interpreted code of Classic ASP. Compiled code executes faster than
interpreted code, but in ASP.NET, the first caller of a page will experience
a performance DELAY as the .NET code gets compiled by the Just In Time
compiler. To avoid this delay, you can pre-JIT your code using the
"NGen.exe" tool.

2. Since "pragma", "no-cache" is not always honored by clients and
"cache-control","private" only works in SOME proxy server environments, they
are not really a true test of performance. ASP.NET introduces a server-side
"cache" object, which (when used properly) can dramatically improve
performance. There is also an OutputCache that allows for entire pages or
fragments of pages to be cached.

3. Classic ASP provided native objects such as Request, Response, Server,
Session, Application & Error. In .NET, there are over 10,000 native objects
at your disposal. Learning about the Framework Class Library, namespaces
and assemblies will help you find the right object for the right job.

4. Because so much is new and different from Classic ASP, yet some of your
Classic ASP code (and VBScript code) can be ported to ASP.NET and VB.NET,
newcomers to ASP.NET and VB.NET tend to stick with what they know, rather
than take the time to learn the new ways of ASP.NET and VB.NET. It does
take time but, for example, I think it's been about 4 years since I wrote:
Response.anything. Sure, I could still use the Response object, but .NET
provides so many other (and better) mechanisms for rendering to the client,
that there's no need.

The bottom line is that it is completely normal to look at Classic ASP and
ASP.NET and not see any improvement using ASP.NET, but that is simply
because there is much to know about it and when used properly, ASP.NET blows
Classic ASP away every time.

Good luck!

-Scott

<mp****@htxml.comwrote in message
news:11*********************@i42g2000cwa.googlegro ups.com...
>I just converted lots of ASP to ASP.NET (using ASP2ASPX) and noticed a
drop in rendering speed. For example, one ASP page takes 0.0313s to be
generated while the ASP.NET version takes 0.4842s. Granted they are
both fast but the ASP speeds makes me think ASP object caching is
better/faster (as the SQL is the exactly the same)

Either that or I don't have something setup correctly (yet). ASP
pages use:

Response.Expires = -1
Response.ExpiresAbsolute = strDatabaseTime - 2
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "No-Store"

for caching while the ASP.NET pages use:

Response.Expires = CInt(- 1)
Response.AddHeader("pragma", "no-cache")
Response.AddHeader("cache-control", "private")

So both should be re-rendered every hit. Do you have any suggestions
where I could start looking or good tools for profiling the diffs?

Thank you,
Michael

Sep 6 '06 #3
Thank you for the suggestions but using:

<%@ Page language = "VB" Explicit="True" EnableViewState="False" %>

didn't speed things up at all..

ms*****@hotmail.com wrote:
Have you tried disabling the ViewState? If you're converting from
traditional ASP to ASP.NET then its highly unlikely that you have any
need for the ViewState.
I *never* enable ViewState unless absolutely necessary (usually due to
3rd party controls).

Add the following setting to your page heading on the client side or
set it using the properties for the page:

EnableViewState="False"

m
Sep 6 '06 #4
1. All the server-side code you write in .NET is compiled code vs. the
interpreted code of Classic ASP. Compiled code executes faster than
interpreted code, but in ASP.NET, the first caller of a page will experience
a performance DELAY as the .NET code gets compiled by the Just In Time
compiler. To avoid this delay, you can pre-JIT your code using the
"NGen.exe" tool.
The load times I mentioned doesn't pertain to first-time hits as the
times are the same on subsequent hits. Still, thanks for the NGen.exe
tip!
2. Since "pragma", "no-cache" is not always honored by clients and
"cache-control","private" only works in SOME proxy server environments, they
are not really a true test of performance. ASP.NET introduces a server-side
"cache" object, which (when used properly) can dramatically improve
performance. There is also an OutputCache that allows for entire pages or
fragments of pages to be cached.
I'll look into this.
3. Classic ASP provided native objects such as Request, Response, Server,
Session, Application & Error. In .NET, there are over 10,000 native objects
at your disposal. Learning about the Framework Class Library, namespaces
and assemblies will help you find the right object for the right job.
We are using much of the same code (want to keep it as close as
possible for this first round since I'm dealing with 6 million lines of
ASP). We will definitely explore the .NET libraries (including third
parties such as NHibernate, dotLucene, etc.
4. Because so much is new and different from Classic ASP, yet some of your
Classic ASP code (and VBScript code) can be ported to ASP.NET and VB.NET,
newcomers to ASP.NET and VB.NET tend to stick with what they know, rather
than take the time to learn the new ways of ASP.NET and VB.NET. It does
take time but, for example, I think it's been about 4 years since I wrote:
Response.anything. Sure, I could still use the Response object, but .NET
provides so many other (and better) mechanisms for rendering to the client,
that there's no need.
This will be the challenge, <ASP:Repeaterseems to look very useful
instead of dynamically including code chunks within a VBScript loop
(yuck).
The bottom line is that it is completely normal to look at Classic ASP and
ASP.NET and not see any improvement using ASP.NET, but that is simply
because there is much to know about it and when used properly, ASP.NET blows
Classic ASP away every time.
I do hope so -- it took a month to do the conversion and it will
probably take a year to tweak the rest.

Thank you,
Michael

Sep 6 '06 #5

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

Similar topics

0
by: Tom O'Neill | last post by:
------=_NextPart_000_055D_01C3672C.FBA9D860 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Is there any difference in speed between the following...
1
by: Paul | last post by:
Hello, I know mysql update queries can only utilize one index, making them slow in some cases. My update are taking about 3 hours, joining 2 tables on their primary keys. (table sizes about 1...
1
by: Ralph Noble | last post by:
I have two avenues to access my primary SQL Server. (I work remotely using a VPN connection.) Usually, I hit the server from my local machine but I also login to a desktop machine inside the...
1
by: Serdar C. | last post by:
i am trying to write a program to control upload and download speeds over specific ports like i have 128kbit download and 64kbit upload speed total.. i want to let port xxxx to use maximum amount...
0
by: Brian Henry | last post by:
is there a way to get the current speed that a network interface is sending and recieveing data at that moment in VB.net? thanks
0
by: Chaos | last post by:
For the Program I Am Making I Make Multiple HTTP Request to My Server. I found that using urllib2 it was pretty slow, when I activated the program and tested it it would hang from 2secs-5secs since...
3
by: sbowman | last post by:
I have a database that I was using for Monthly Statistics. I've recently loaded hundreds of thousands of records of historical data. Now my queries are running really slow!! Is there anything I can...
3
natalie99
by: natalie99 | last post by:
Hello I need a very simple question answered if anyone could please help :) After moving office locations, our shared network connection (attached to old building where employees still use the...
3
GaryTexmo
by: GaryTexmo | last post by:
I'm curious about XNA and drawing speeds... I'm finding I'm not getting what I would have expected. First, a little background on me. I started programming in QuickBasic and really liked the graphics...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.