Open Nav

优化ASP串中处理性能

以下是资料介绍,如需要完整的请充值下载.
1.无需注册登录,支付后按照提示操作即可获取该资料.
2.资料以网页介绍的为准,下载后不会有水印.仅供学习参考之用.
   帮助中心
资料介绍:
摘要: 大多数活跃的服务器页(ASP)应用依赖串联建立HTML 格式化的数据然后被用户使用。本文对各种创造HTML 数据流的方法进行了比较,其中有一些在特定的情况下有更好的性能。asp 和Visual Basic编程设计的方法被合理采用了。
绪论
开发者编写ASP 页,其实是在创造一串格式化正文通过ASP提供给网络客户。你能使用多中不同的方法创造该正文,但是你所选择的方法网络应用的性能和可测量性有很大影响。在帮助用户协调他们Web 应用性能的许多场合中,我已经发现主要的获胜因素是那个改变HTML数据流的方式。在本文,我将展示一些普通的技术并且测试他们对简单的asp页的性能的影响。
asp 设计
很多asp开发者已经遵循好的软件设计原则并且模块化他们的代码。这种设计通常采取用某一页的部分离散的功能模块组成新页的形式。线性输出由这些功能实现,通常是HTML代码表,然后能通过各种各样结合形式形成完整的一页。一些开发者已经更深入一步研究并且把这些HTML函数作为Visual Basic COM的组成部分,希望受益于额外的编译代码提供的执行性能。
虽然这是一个好的设计惯例,通过这种方法建立数据流对网络站点执行效率有较大影响。不管现实操作执行是从asp的包含文件还是Visual Basic COM 零部件。(毕业设计 ) [资料来源:https://www.doc163.com]
数据串串联
考虑下列代码碎片取自WriteHTML函数。 命名数据的参数仅仅是一个数组包含一些需要被格式化成一个表结构的数据(数据从数据库返回, 例如)。
Function WriteHTML( Data )
Dim nRep
For nRep = 0 to 99
   sHTML = sHTML & VBcrlf _
         & "<TR><TD>" & (nRep + 1) & "</TD><TD>" _
         & Data( 0, nRep ) & "</TD><TD>" _
         & Data( 1, nRep ) & "</TD><TD>" _
         & Data( 2, nRep ) & "</TD><TD>" _
         & Data( 3, nRep ) & "</TD><TD>" _
         & Data( 4, nRep ) & "</TD><TD>" _
         & Data( 5, nRep ) & "</TD></TR>" [资料来源:http://doc163.com]
Next
WriteHTML = sHTML

Summary: Most Active Server Pages (ASP) applications rely on string concatenation to build HTML-formatted data that is then presented to users. This article contains a comparison of several ways to create this HTML data stream, some of which provide better performance than others for a given situation. A reasonable knowledge of asp and Visual Basic programming is assumed. (11 printed pages)
Contents
Introduction
asp Design
String Concatenation
The Quick and Easy Solution
The StringBuilder
The Built-in Method
Testing
Results
Conclusion
Introduction
When writing ASP pages, the developer is really just creating a stream of formatted text that is written to the Web client via the Response object provided by ASP. You can build this text stream in several different ways and the method you choose can have a large impact on both the performance and the scalability of the Web application. On numerous occasions in which I have helped customers with performance-tuning their Web applications, I have found that one of the major wins has come from changing the way that the HTML stream is created. In this article I will show a few of the common techniques and test what effect they have on the performance of a simple asp page.
[资料来源:www.doc163.com]

asp Design
Many asp developers have followed good software engineering principles and modularized their code wherever possible. This design normally takes the form of a number of include files that contain functions modeling particular discrete sections of a page. The string outputs from these functions, usually HTML table code, can then be used in various combinations to build a complete page. Some developers have taken this a stage further and moved these HTML functions into Visual Basic COM components, hoping to benefit from the extra performance that compiled code can offer.
Although this is certainly a good design practice, the method used to build the strings that form these discrete HTML code components can have a large bearing on how well the Web site performs and scales—regardless of whether the actual operation is performed from within an asp include file or a Visual Basic COM component.
String Concatenation
Consider the following code fragment taken from a function called WriteHTML. The parameter named Data is simply an array of strings containing some data that needs to be formatted into a table structure (data returned from a database, for instance).
[资料来源:http://www.doc163.com]

Function WriteHTML( Data )
Dim nRep
For nRep = 0 to 99
         sHTML = sHTML & VBcrlf _
             & "<TR><TD>" & (nRep + 1) & "</TD><TD>" _
             & Data( 0, nRep ) & "</TD><TD>" _
             & Data( 1, nRep ) & "</TD><TD>" _
             & Data( 2, nRep ) & "</TD><TD>" _
             & Data( 3, nRep ) & "</TD><TD>" _
             & Data( 4, nRep ) & "</TD><TD>" _
             & Data( 5, nRep ) & "</TD></TR>" [资料来源:http://www.doc163.com]
Next
全文13700字
  • 关于资料
    提供的资料属本站所有,真实可靠,确保下载的内容与网页资料介绍一致.
  • 如何下载
    提供下载链接或发送至您的邮箱,资料可重复发送,若未收到请联系客服.
  • 疑难帮助
    下载后提供一定的帮助,收到资料后若有疑难问题,可联系客服提供帮助.
  • 关于服务
    确保下载的资料和介绍一致,如核实与资料介绍不符,可申请售后.
  • 资料仅供参考和学习交流之用,请勿做其他非法用途,转载必究,如有侵犯您的权利或有损您的利益,请联系本站,经查实我们会立即进行修正! 版权所有,严禁转载
    doc163.com Copyright © 2012-2024 苏ICP备2021029856号-4