I tried adding it but that makes the performance even worse...it's like
crawling. I am posting my 2 pieces of codes, so that anyone can try it on
your server. Thanks in advance!
Create a HTML page and make 2 hyper links pointing to these 2 files, then
Right-click -> save target as -> You will see the BIG difference between the
performance between the two.
-------------------------------------------------------
test.aspx
-------------------------------------------------------
<%@ Page Language="C#" %>
<%@ Import Namespace="System.IO" %>
<script language="C#" runat="server">
void Page_Load() {
// Response.BufferOutput = false;
int size= 10485760; // around 10 MB data
StringBuilder buffer = new StringBuilder(size);
String str = "";
for (int i=1; i<=1024; i++)
buffer.Append("x");
str = buffer.ToString();
for (int j=1; j<=size/1024; j++)
Response.Write(str);
} // load
</script>
-------------------------------------------------------
test.asp
-------------------------------------------------------
<%
dim i, j, size, buffer
size = 10485760
for i = 1 to 1024
buffer = buffer & "x"
next
for j = 1 to (size / 1024)
response.write(buffer)
next
%>
-------------------------------------------------------
"Ed Courtenay" <replace-this-with-my-first-name@edcourtenay.co.uk> wrote in
message news:%23WarEKTOEHA.3016@tk2msftngp13.phx.gbl...[color=blue]
> BlueBall wrote:[color=green]
> > StringBuilder doesn't help because in my code, I don't actually repeat[/color][/color]
the[color=blue][color=green]
> > buffer generating part.
> >
> > Try to run it on your IIS, you will see what I mean. In order to verify
> > this is an ASPX performance problem (or possible my coding algorithm or
> > config problem), I have created an old fashion ASP page:
> >
> > <%
> > dim i, j, size, buffer
> > size= 10048576
> > for i = 1 to 1024
> > buffer = buffer & "x"
> > next
> > for j = 1 to (size / 1024)
> > response.write(buffer)
> > next
> > %>
> >
> > Create a hyper link in a new HTML page and link to this ASP page, and[/color][/color]
then[color=blue][color=green]
> > create another link that links to ASPX page you wrote (or the one I[/color][/color]
posted[color=blue][color=green]
> > earlier). You can see the BIG difference in performance. ASP page is
> > faster than ASPX page at least 3 times... I am frustrated!!!
> >
> > B.B.
> >[/color]
>
> I think I can see where your problem is.
>
> By default, ASP does not buffer output whereas ASP.NET does. Therefore,
> your ASP code is sending the response directly to the client, whereas
> ASP.Net is building the entire output before sending.
>
> Try setting Response.BufferOuput to false in your Page.Load event
> handler and then try your test again.
>
>
>
>
>
>
> --
>
> Ed Courtenay
> [MCP, MCSD]
>
http://www.edcourtenay.co.uk[/color]