473,811 Members | 3,135 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASP Classic Performance Question

I'm maintaining an ASP Classic file that has HTML withing
Response.Write methods...such as.
<%
Response.Write "<table><tr><td >"
Response.Write testVariable
Response.Write "</td></tr></table>"
%>

Would their be a performance hit if I were to write this instead?

<table><tr><td> <%=testVariable %></td></tr></table>

I think, no, but I need some confirmation.

Thanks for any advice/suggestions.

Sep 21 '06 #1
14 2223
That is what i usually do. works fine for me.
James Jones


"Merovingia n" <st***********@ gmail.comwrote in message
news:11******** **************@ k70g2000cwa.goo glegroups.com.. .
I'm maintaining an ASP Classic file that has HTML withing
Response.Write methods...such as.
<%
Response.Write "<table><tr><td >"
Response.Write testVariable
Response.Write "</td></tr></table>"
%>

Would their be a performance hit if I were to write this instead?

<table><tr><td> <%=testVariable %></td></tr></table>

I think, no, but I need some confirmation.

Thanks for any advice/suggestions.

Sep 21 '06 #2
Merovingian wrote:
I'm maintaining an ASP Classic file that has HTML withing
Response.Write methods...such as.
<%
Response.Write "<table><tr><td >"
Response.Write testVariable
Response.Write "</td></tr></table>"
%>

Would their be a performance hit if I were to write this instead?

<table><tr><td> <%=testVariable %></td></tr></table>

I think, no, but I need some confirmation.
No. I think in IIS4, there used to be, but that is no longer a factor.
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Sep 21 '06 #3
Thanks Bob!

Bob Barrows [MVP] wrote:
Merovingian wrote:
I'm maintaining an ASP Classic file that has HTML withing
Response.Write methods...such as.
<%
Response.Write "<table><tr><td >"
Response.Write testVariable
Response.Write "</td></tr></table>"
%>

Would their be a performance hit if I were to write this instead?

<table><tr><td> <%=testVariable %></td></tr></table>

I think, no, but I need some confirmation.
No. I think in IIS4, there used to be, but that is no longer a factor.
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Sep 21 '06 #4
Could I get some links to back up the performance between the two
examples?

Merovingian wrote:
Thanks Bob!

Bob Barrows [MVP] wrote:
Merovingian wrote:
I'm maintaining an ASP Classic file that has HTML withing
Response.Write methods...such as.
>
>
<%
Response.Write "<table><tr><td >"
Response.Write testVariable
Response.Write "</td></tr></table>"
%>
>
Would their be a performance hit if I were to write this instead?
>
<table><tr><td> <%=testVariable %></td></tr></table>
>
I think, no, but I need some confirmation.
>
No. I think in IIS4, there used to be, but that is no longer a factor.
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Sep 21 '06 #5
there's not going to be a difference to worry about, but you could use a timestamp to note start of page processing and end of page
processing then calc difference.
personally, I think before attempting to solve a performance problem, perhaps you should demonstrate that the problem exists...
"Merovingia n" <st***********@ gmail.comwrote in message news:11******** **************@ b28g2000cwb.goo glegroups.com.. .
Could I get some links to back up the performance between the two
examples?

Merovingian wrote:
>Thanks Bob!

Bob Barrows [MVP] wrote:
Merovingian wrote:
I'm maintaining an ASP Classic file that has HTML withing
Response.Write methods...such as.
<%
Response.Write "<table><tr><td >"
Response.Write testVariable
Response.Write "</td></tr></table>"
%>

Would their be a performance hit if I were to write this instead?

<table><tr><td> <%=testVariable %></td></tr></table>

I think, no, but I need some confirmation.

No. I think in IIS4, there used to be, but that is no longer a factor.
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Sep 21 '06 #6
This is a topic of discussion between me and another developer and I
can't seem to convey that it makes no difference except that the
readability and mantainability of the code is easier without all the
markup in the ASP tag delimiters. Personally, we wouldn't be having
this conversation if we were using ASP.NET.

Jon Paal wrote:
there's not going to be a difference to worry about, but you could use a timestamp to note start of page processing and end of page
processing then calc difference.
personally, I think before attempting to solve a performance problem, perhaps you should demonstrate that the problem exists...
"Merovingia n" <st***********@ gmail.comwrote in message news:11******** **************@ b28g2000cwb.goo glegroups.com.. .
Could I get some links to back up the performance between the two
examples?

Merovingian wrote:
Thanks Bob!

Bob Barrows [MVP] wrote:
Merovingian wrote:
I'm maintaining an ASP Classic file that has HTML withing
Response.Write methods...such as.
>
>
<%
Response.Write "<table><tr><td >"
Response.Write testVariable
Response.Write "</td></tr></table>"
%>
>
Would their be a performance hit if I were to write this instead?
>
<table><tr><td> <%=testVariable %></td></tr></table>
>
I think, no, but I need some confirmation.
>
No. I think in IIS4, there used to be, but that is no longer a factor.
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Sep 21 '06 #7
I doubt a cite* would convince him. I suspect the only thing that would
probably convince him is a test. So take 5 minutes and create a test package
and run it.
*I have no cites. I really don't remember where I read that the performance
issue was solved with IIS 5.1. You may find someone with a link in the iis
group.

Merovingian wrote:
This is a topic of discussion between me and another developer and I
can't seem to convey that it makes no difference except that the
readability and mantainability of the code is easier without all the
markup in the ASP tag delimiters. Personally, we wouldn't be having
this conversation if we were using ASP.NET.

Jon Paal wrote:
>there's not going to be a difference to worry about, but you could
use a timestamp to note start of page processing and end of page
processing then calc difference.
personally, I think before attempting to solve a performance
problem, perhaps you should demonstrate that the problem exists...
"Merovingian " <st***********@ gmail.comwrote in message
news:11******* *************** @b28g2000cwb.go oglegroups.com. ..
>>Could I get some links to back up the performance between the two
examples?

Merovingian wrote:
Thanks Bob!

Bob Barrows [MVP] wrote:
Merovingi an wrote:
>I'm maintaining an ASP Classic file that has HTML withing
>Response.W rite methods...such as.
>>
>>
><%
>Response.W rite "<table><tr><td >"
>Response.W rite testVariable
>Response.W rite "</td></tr></table>"
>%>
>>
>Would their be a performance hit if I were to write this instead?
>>
><table><tr ><td><%=testVar iable%></td></tr></table>
>>
>I think, no, but I need some confirmation.
>>
No. I think in IIS4, there used to be, but that is no longer a
factor. --
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will
get a
quicker response by posting to the newsgroup.
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Sep 22 '06 #8
"Merovingia n" <st***********@ gmail.comwrote in message
news:11******** **************@ k70g2000cwa.goo glegroups.com.. .
I'm maintaining an ASP Classic file that has HTML withing
Response.Write methods...such as.

<%
Response.Write "<table><tr><td >"
Response.Write testVariable
Response.Write "</td></tr></table>"
%>

Would their be a performance hit if I were to write this instead?

<table><tr><td> <%=testVariable %></td></tr></table>

I think, no, but I need some confirmation.

Thanks for any advice/suggestions.

VBScript String Concatenation
(And Why It Should Be Avoided Like The Plague)
http://www.asp101.com/articles/marcu...on/default.asp
"... here are the results of the benchmarks ..."
How do I make my ASP pages more efficient?
http://classicasp.aspfaq.com/general...s-more-efficie
nt.html
"Don't generate large strings in single variables -- concatenation is very
expensive."
Here's what I do:

<%
Dim arrSTR()
ReDim arrSTR(100)
Dim intSTR
intSTR = 0
Dim strSTR
'*
Append "<table border='0'>"
Append "<tr>"
Append " <th>`Hello World!`<hr></th>"
Append "</tr>"
Append "</table>"
'*
Response.Write Concat()

Sub Append(strSTR)
'****
'* Append strings to array entries ReDim as needed; (see "Concat()") .
'****
strSTR = strSTR & ""
If intSTR UBound(arrSTR) Then
ReDim Preserve arrSTR(UBound(a rrSTR) + 100)
End If
arrSTR(intSTR) = strSTR & vbCrLf
intSTR = intSTR + 1
End Sub

Function Concat()
'****
'* Concatenates array entries into a single string; (see "Append()") .
'****
Redim Preserve arrSTR(intSTR)
Concat = Replace(Join(ar rSTR,""),"`",Ch r(34))
Erase arrSTR
ReDim arrSTR(100)
intSTR = 0
End Function
%>

Only one Response.Write( ) and the code is lot more readable.
Sep 22 '06 #9
Merovingian wrote:
I'm maintaining an ASP Classic file that has HTML withing
Response.Write methods...such as.
<%
Response.Write "<table><tr><td >"
Response.Write testVariable
Response.Write "</td></tr></table>"
%>
Would their be a performance hit if I were to write this instead?
<table><tr><td> <%=testVariable %></td></tr></table>
No.
An ASP page is, on the first request for that page, compiled to p-code,
executed and the p-code cached for subsequent executions. During the
compile step, any embedded HTML is replaced by a call to the
(unpublished) Response.WriteB lock(N) method. Here N refers to the Nth
"block" of embedded HTML. Blocks numbers start with 0. You can test this
by writing explicit calls to Response.WriteB lock() for your edification.

Consequently output is either from a Response.Write( ) call or a
Response.WriteB lock() call. Any difference in speed is insignificant.

We've discussed this before many times on these newsgroups:
http://groups.google.com/groups?as_q...=2006&safe=off

Further details on how ASP is compiled and executed
See in particular "Appendix 3: ASP Caching":
http://www.microsoft.com/technet/pro...on130121120120

Explanation of compilation with examples of ASP p-code:
http://groups.google.com/group/micro...e=source&hl=en
Sep 22 '06 #10

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

Similar topics

7
4997
by: Adi Schwarz | last post by:
I was asking myself what solution is better considering performance. I want to create some classes depending on a varable (for different languages). Of course, if the classes are huge I write them in seperate files and include the appropriate file. But until which size it is better to define them "inline" directly in the if - statement? Or in other words: How much time does the include statement need in comparison to parsing some code?
2
1755
by: inna | last post by:
Hello. I have query performance question. I need to optimize procedure CREATE PROCEDURE dbo.SECUQUSRCOMPACCES @P1 VARCHAR(50), @P2 INTEGER AS DECLARE @IORGANIZATIONID INTEGER EXECUTE dbo.ORGNQGETORGID @PORGUNIQUEID = @IORGANIZATIONID OUTPUT
7
2342
by: Randell D. | last post by:
Folks, I have a Javascript performance question that I might have problems explaining... In PHP, better performance can be obtained dealing directly with a variable, as opposed to an element in an array... Thus, if I have a programming routine that utilises $a several times, it is better to write the value contained in $a to something else, for example, $vartmp, and have my routine instead use this for its work... I believe
8
3274
by: Együd Csaba | last post by:
Hi All, how can I improve the query performance in the following situation: I have a big (4.5+ million rows) table. One query takes approx. 9 sec to finish resulting ~10000 rows. But if I run simultaneously 4 similar queries it takes nearly 5 minutes instead of 4 times 9 seconds or something near of that. here is a sample query: select mertido, fomeazon, ertektipus, mertertek from t_me30 where fomeazon in (select distinct fomeazon...
6
1720
by: Mike | last post by:
Lets just say my app is done HOO HOO. Now, I'm accessing the database via a web service and one thing i noticed that my app is running real slow. When I first started working on the app is ran pretty quick returned the data to the screens in about 2 - 3 seconds. Now its going about 5 - 10 seconds. How can I beef it up for better performance.
12
2382
by: mcp6453 | last post by:
My small company has a web site that is developed in "Classic ASP", which is, I'm told, different from just "ASP". It is clear to me that we are not using ASP.NET. The site is hosted on a shared Windows Server and access a Microsoft SQL Server 2000, I think. We are having a terrible time finding someone to do some code updates. Part of the problem is that I am not familiar enough with ASP to know whether I am asking the right questions....
30
3555
by: galiorenye | last post by:
Hi, Given this code: A** ppA = new A*; A *pA = NULL; for(int i = 0; i < 10; ++i) { pA = ppA; //do something with pA
0
1009
by: Aykut Canturk | last post by:
As all we know there are 2 ways for binding gridview to sql table. using sqldata adapter and using code. What I want to know is, in large tables, is there a perfomance difference. When using code we don't specify any page size or anything. so all data must be retreived from sql table to web server memory, is that right ? Maybe, only maybe, sql data adapter uses different approach about loading table rows for perfomance issues. in VB6,...
0
9722
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10644
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10393
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9200
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7664
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6882
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4334
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3863
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.