Performance two, test environment
This test uses a total of 21 ASP files that can be downloaded from the back of this article. Each page is set up to run three different queries, returning 0, 25, and 250 records, respectively. This will help us isolate the initialization of the page itself, the overhead of running it, and the overhead of iterating through recordsets.
For ease of testing, both the database connection string and the SQL command string are saved as application variables in Global.asa. Since our test database is SQL Server 7.0, the connection string specifies OLE DB as the connection provider, and the test data comes from the Northwind database of SQL Server. The SQL Select command extracts 7 specified fields from the Northwind Orders table.
< SCRIPT language=vbscript Runat=server >
Sub Application_OnStart
Application ("Conn") = "Provider=sqloledb;" & _
"Server=myserver;" & _
"UID=SA;" & _
"Pwd=;" & _
"Database=northwind"
Application ("SQL") = "SELECT top 0 OrderID," & _
"CustomerID," & _
"EmployeeID," & _
"OrderDate," & _
"RequiredDate," & _
"ShippedDate," & _
"Freight" & _
"From [Orders]"
End Sub
</script >
' Alternate sql-25 Records
Application ("SQL") = "SELECT Top OrderID," & _
"CustomerID," & _
"EmployeeID," & _
"OrderDate," & _
"RequiredDate," & _
"ShippedDate," & _
"Freight" & _
"From [Orders]"
' Alternate sql-250 Records
Application ("SQL") = "SELECT Top OrderID," & _
"CustomerID," & _
"EmployeeID," & _
"OrderDate," & _
"RequiredDate," & _
"ShippedDate," & _
"Freight" & _
"From [Orders]"
The test server is configured as follows: 450 Mhz pentium,512 MB ram,nt Server 4.0 SP5,MDAC 2.1 (Data access component), and the 5.0 version of the Microsoft Scripting engine. SQL Server runs on another machine that has a similar configuration. As in the first section, we still use the Microsoft Web application Stress Tool record from the first page to the time when the last byte was received from the server (Ttlb,time to the end byte), in milliseconds. The test script calls each page more than 1300 times and runs for about 20 hours, and the time shown below is the average ttlb of the session. Remember, as with the first part, we only care about the efficiency of the Code, not its scalability or server performance.
Also, note that we have enabled server buffering. In addition, in order for all file names to be of the same length, one or more underscores are embedded in some file names.