Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP server loading 1

Status
Not open for further replies.

Microbe

Programmer
Oct 16, 2000
607
AU
Can anyone tell me whether using code such as

======
<% code code code%>
html
<%code code code%>
html
<%code code code%>
html
======

makes any significant difference in speed and overheads compared to putting all the code into one <% %> pair and using response.write for the html?

Steve Davis
hey.you@hahaha.com.au
 
If I remember rightly it is more effcient in the case you have shown above to use Response.Write
this is because everytime that a <% %> section is hit execution has to transfer to trhe ASP engine and so in your example you are doing a lot of shifting between execution/processing engines.

James :) James Culshaw
jculshaw@active-data-solutions.co.uk
 
Yes, James is right. But if I may elaborate a bit, to make the pages even a bit more effective, you can either turn on your buffering (Response.Buffer = True) and/or really pack information into your response writes. For example, if you're going to build a table, drop it all into a variable then Response.Write the variable. Of course this makes for sloppy HTML results when someone views your code if you don't use some vbCrLf's in there but hey, get a little discipline in your code and drop them in there. There's nothing better than looking at someone's ASP page and seeing it nice and formatted, not just some straight stream of html output.

=)
Ed (RoadRacer) Holguin

&quot;I Hate Computers!&quot;
 
The aspToday article is excellent for showing how the way that you code can effect the speed of your program. I suggest anyone who has not checked this out do so.

Walt III
SAElukewl@netscape.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top