Speed////////////////////////////////////////////////////
{The client template for testing}
////////////////////////////////////////////////////
<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 transitional//en" >
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<meta name= "generator" content= "EditPlus" >
<meta name= "Author" content= "" >
<meta name= "Keywords" content= "" >
<meta name= "Description" content= "" >
</HEAD>
<BODY>
<script language= "VBScript" >
Dim t
T=timer
</script>
<!--here put the server test script-->
<script language= "VBScript" >
Document.Write "|" & (TIMER-T) ' Output the time taken by the client to fully accept all data
</script>
</BODY>
</HTML>
////////////////////////////////////////////////////
{The code for each script you tested}
////////////////////////////////////////////////////
//--------------------------------------------------
Test-js.asp
Use an array to collect all the character channeling and finally join the Join function
//--------------------------------------------------
<script language= "JavaScript" runat= "Server" >
var i,t,s;
var a=new Array (10000);
t= (New Date ()). GetTime ();
for (i=0;i<10000;i++) {
S+=string (i) + "\ n";
A[i]=string (i);
}
S=a.join ("\ n");
Response.Write (s);
Response.Write ("<br>" +string (New Date ()). GetTime ()-T);
A=null;
S=null;
</Script>
//--------------------------------------------------
////////////////////////////////////////////////////
//--------------------------------------------------
Test-js2.asp
//--------------------------------------------------
<script language= "JavaScript" runat= "Server" >
var i,t,s= "";
t= (New Date ()). GetTime ();
for (i=0;i<10000;i++) {
S+=string (i) + "\ n";
}
Response.Write (s);
Response.Write (New Date ()). GetTime ()-T);
A=null;
S=null;
</Script>
//--------------------------------------------------
////////////////////////////////////////////////////
//--------------------------------------------------
Test-js3.asp
Each data is obtained, and is immediately exported to the data stream.
//--------------------------------------------------
<script language= "JavaScript" runat= "Server" >
var i,t;
t= (New Date ()). GetTime ();
for (i=0;i<10000;i++) {
Response.Write (i+ "\ n");
}
Response.Write ("<br>");
Response.Write (New Date ()). GetTime ()-T);
</Script>
//--------------------------------------------------
////////////////////////////////////////////////////
//--------------------------------------------------
Test-js3.asp
This program creates a zero file and enters all the content into the file, and the final unified output
The component used to establish the zero file is the FSO
//--------------------------------------------------
<script language= "JavaScript" runat= "Server" >
var i,t;
t= (New Date ()). GetTime ();
var fso=server.createobject ("Scripting.FileSystemObject");/Create an FSO object
var f=fso. CreateTextFile (Server.MapPath ("Temp.txt"), true);//Create a zero file through the FSO object
for (i=0;i<10000;i++) {
F.writeline (i);
}
F.close ();
F=fso. OpenTextFile (Server.MapPath ("Temp.txt"), 1);
Response.Write (F.readall ())//Read the contents of a zero file
F.close ();
F=null;
Fso=null;
Response.Write ("<br>");
Response.Write (New Date ()). GetTime ()-T);
</Script>
//--------------------------------------------------
////////////////////////////////////////////////////
//--------------------------------------------------
Test-js5.asp
This program creates a zero file and enters all the content into the file, and the final unified output
The component used to establish the zero file is ADODB.stream
//--------------------------------------------------
<script language= "JavaScript" runat= "Server" >
var i,t;
t= (New Date ()). GetTime ();
var ado=server.createobject ("ADODB.") Stream ");
Ado. mode=3;//set to readable and writable
Ado. type=2;//set Content to text
Ado. Open ();
for (i=0;i<10000;i++) {
Ado. WRITETEXT (i+ "\ n");
}
Ado. SaveToFile (Server.MapPath ("Temp.txt"), 2);//Save to read
Response.Write (ADO. ReadText (-1));
Ado. Close ();
Ado=null;
Response.Write ("<br>");
Response.Write (New Date ()). GetTime ()-T);
</Script>
//-------------------------------------------