ASP Performance Test Part II (EXT) (12)

Source: Internet
Author: User
Tags require
12, summary
Here are the rules we get in this second section:
Avoid including adovbs.inc files, and access and use ADO constants in other ways.
If you use only one recordset, assign the connection string directly to the ActiveConnection property.
When multiple recordsets are used within the same page, a single Connection object is created and shared by the ActiveConnection property.
Use the simplest cursor types and record locking methods that are appropriate for processing tasks.
Instantiate recordsets with Adodb.recordset classes for the best performance and flexibility.
You don't have to worry about setting the properties of the recordset individually.
You should avoid using local recordsets unless you do require a recordset to be localized.
If the data in the recordset does not need to be individually manipulated and can be formatted in a consistent manner, the data is extracted using the GetString method.
If you require a more flexible format, but you do not need to use the recordset's metadata, use GetRows to extract the data to an array.
If a more flexible format is required, and the metadata of the recordset is used, bind the field to the variable before entering the data extraction loop.
Always avoid referencing fields by name.
Do not use temporary strings to collect output.
The second part of the test once again shows that small changes in code can lead to significant performance differences. Compare the first Test and iterate the fastest ado__09.asp of the recordset, you can see that the response time is reduced by 50%.
  
Comparing the first Test and using the GetString, the best implementation of this comprehensive performance, you can see the response time reduced to a small part of the original.
  
So be sure to remember that you never take it for granted. If you are not sure if your practice is appropriate, you might want to test a few examples.

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.