How to improve the efficiency of ASP page execution _ Application techniques

Source: Internet
Author: User
Tags database issues oracle database

Most of these are hardware-related. In fact, in software, good program design method and correct parameter configuration can also improve the performance of the program, sometimes in the same situation as long as the change of a parameter, program execution efficiency can be greatly improved. This article will try to do some research in this area.
I. Factors that affect performance
The performance of the ASP program is mainly decided by the following 2 major aspects:
Efficiency of 1.HTML page execution
2. Reaction time, wherein the reaction time is mainly subject to the following elements:
(1). Efficiency of ASP page execution
(2). Database factors
Let's discuss it in detail below.
Two. Detailed discussion
1. Factors that affect HTML
The efficiency of HTML page execution is a pure client issue. The main factor affecting this problem is the client's hardware and his network bandwidth. In addition, some of the following factors can also affect the efficiency of HTML page execution.
(1). Image factors. Try to avoid using images on HTML pages. This is because when a browser requests a page, if the page contains n images, this will allow the browser to request n calls to the Web server. This request can degrade the loading process of the page. And then affect the speed.
(2). Framework issues. The use of frames in the Web page also reduces the loading process of the page, and similar to the image factor, loading an n-frame requires a request n times.
(3). Table problems, try to avoid using tables, especially to avoid using multiple tables, complex tables can affect the efficiency of HTML execution.
(4). Remove the extra tags, let's take a look at the following example:

Copy Code code as follows:

<Body><br>
<p><font face= "Verdana" size= "4" ><br>
</font></P><br>
<p><font face= "Verdana" size= "4" ><br>
</font></P><br>
<p><font face= "Verdana" size= "4" ><br>
</font></P><br>
</Body><br>
You can remove the <font> tags as follows:
<Body><br>
<font face= "Verdana" size= "4" ><br>
<P><br>
</P> <br>
<P> <br>
</P><br>
<P> <br>
</P><br>
<font> </Body><br>

(5). Reduce the annotation, which will reduce the size of the file. And then increase the loading speed.
(6). Avoid using long file names and use relative paths to access other files on the page as much as possible.
(7). Try to avoid using Java Applets in HTML pages. For example, if you want to use Java applets to handle animations, you might consider using a GIF file or flash instead, which will be much faster than the Java applets.
2. elements that affect ASP
(1). Convert the object variable to the cost variable as much as possible, because reading the land variable is much faster than reading the object variable.
A slow example:
Copy Code code as follows:

If Myobj.value = 0 Then
Do something
ElseIf myobj.value > 0 Then
Do something
ElseIf Myobj.value < 0 Then
Do something
End If

A quick example:
Copy Code code as follows:

MyVar = Myobj.value
If MyVar = 0 Then
Do something
ElseIf MyVar > 0 Then
Do something
ElseIf MyVar < 0 Then
Do something
End If

(2). If you are using VBScript 5.0 or newer version, try to use with ... End With statement, which also increases the speed at which your program will run.
A slow example:
Copy Code code as follows:

Myobj.firstname = "Srinivasa"
Myobj.lastname = "Sivakumar"
myobj.city = "Chicago"

A quick example:
Copy Code code as follows:

With MyObj
. FirstName = "Jinhu"
. LastName = "Horse"
. City = "Chuzhou"
End With

(3). In general, avoiding the use of Session variables helps speed up because different ASP pages run in separate threads, and session calls are not, and he is continuous.
3. Database issues
Design a database structure can greatly improve the speed of the program, of course, how to design the database structure is not the issue discussed in this article. Let's assume we've designed the database structure to see what else can be done to improve the speed of the program.
(1). If your database server and Web server are the same, then it is best to separate. This is sure to improve speed.
(2). If you are accessing the database, it is best not to use dynamic SQL statements, using stored procedures or views.
(3). Sometimes allocating the appropriate database buffers improves the performance of the program. This is because, if you are using an Oracle database, you need to open three sessions for each connection. If you can handle these things well, you will improve the performance of the program.
Summarize
In fact, there are many factors affecting the speed of ASP program execution, the above is only a part. Of course, some of the above techniques are not necessarily suitable for all ASP programs, treat different programs to adopt different strategies. Finally hope that the above article can help you.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.