(Author: Green Apple studio compilation of November 10, 2000 Ri 17:20) ASP developers for better performance in their design projects and scalability and continuous efforts. Fortunately, there are many books and sites that provide good advice in this regard. However, these recommendations are the conclusions obtained from the structure of the ASP platform, and there is no measurement for the improvement of the actual performance. Since these recommendations require more complex coding processes and reduce encoding readability, developers can only measure whether their ASP applications can be paid in order to improve their ASP applications without causing actual operation. This article is divided into two parts, I will introduce some performance test results to help developers to determine if a particular initiative is worthy of the future project, but can be updated for the original project. In the first part I will review some basic issues developed by ASP. In the second part, some Optimization ADO functions will be involved, and their results are compared to the ASP page that calls VB COM objects. These results are very eye-catching, even sometimes surprising. In this article, we will answer the following questions: * What is the most effective way to write the contents of the ASP in response stream? * Is the buffer should be turned on? * Do you should consider adding comments to the ASP code? * Is the default language should be explicitly set for the page? * If you don't need it, should you close the Sems status? * Whether the script logic should be placed in a subroutine and a function area? * What is the impact of using the included file? * What load is applied when performing error processing? * Set whether a context process has an impact on performance? All tests are done with Microsoft's Web Application Key Tools (WAST), this is a free tool, which can be found here. I created a simple Test script with WAST, repeatedly calls the ASP page test described below (more than 70,000 times). The reaction time is based on the average last byte total time (TTLB), that is, the time to receive the last bit data from the server from the server. Our test server is a Pentium 166, which is 196MB, and the client is Pentium 450, and memory is 256MB. You may think that the performance of these machines is not very advanced, but don't forget, we are not to test the capacity of the server, we just want to test the time used by the server each time you process. These machines do not do other jobs during the test. WAST test script, test report, and all ASP test pages are included
ZIP file
In you can review and test themselves. What is the most effective way to write the content of the ASP in response? One of the most important reasons used to use ASP is to generate dynamic content on the server. Therefore, it is clear that the starting point of our test is to determine the most suitable way to send dynamic content to the response stream. In a variety of options, there are two most basic: First, use the inline ASP tag, the other is to use the response.write statement. To test these options, we created a simple ASP page that defines some variables and then inserts their values into the table. Although this page is simple or practical, it allows us to separate and test some separate questions. Using ASP Inline Tags The first test includes using an inline ASP tag <% = x%>, where x is an assigned variable. So far, this method is the easiest to perform, and it keeps the page's HTML section a format that is easy to read and maintain.
<% OPTION EXPLICIT Dim FirstName Dim LastName Dim MiddleInitial Dim Address Dim City Dim State Dim PhoneNumber Dim FaxNumber Dim EMail Dim BirthDate FirstName = "John" MiddleInitial = "Q" LastName = "Public" Address = "100 Main Street" City = "New York "state =" NY "phonenumber =" 1-212-555-1234 "faxNumber =" 1-212-555-1234 "Email =" john@public.com "birthdate =" 1/1/1950 "%> < HTML>