asp什么情况下用响应缓冲会提高运行速度?
发布时间:2010-07-14 21:02:00
标签:缓冲,速度,asp
什么情况下用响应缓冲会提高运行速度?
例1、脚本引擎与 HTML 之间的切换频繁,对响应流写操作太多,导致性能下降:
<table>
<% For Each fld in rs.Fields %>
<th><% = fld.Name %></th>
<%
Next
While Not rs.EOF
%>
<tr>
<% For Each fld in rs.Fields %>
<td><% = fld.Value %></td>
<% Next
</tr>
<% rs.MoveNext
Wend %>
</table>
例2、由于所有的代码包含在一个 VBScript 块内,每一行对响应流有一次写操作,效率更高:
<table>
<%
For each fld in rs.Fields
Response.Write (?<th>? & fld.Name & ?</th>? & vbCrLf)
Next
While Not rs.EOF
Response.Write (?<tr>?)
For Each fld in rs.Fields %>
Response.Write(?<td>? & fld.Value & ?</td>? & vbCrLf)
Next
Response.Write ?</tr>?
Wend
%>
</table>
结论:尽可能地多用 Response.Write 调用来代替捆绑紧密的内嵌表达式。
0
投稿
猜你喜欢
- Date 日期和时间对象1. 介绍Date对象,是操作日期和时间的对象。Date对象对日期和时间的操作只能通过方法。2. 构造函数2.1 n
- 主函数(Main Function)是程序中最重要的部分之一,它是程序入口点,也是程序开始执行的地方。1、主函数的定义在 Python 中,
- 注意:我使用的是 Entity Framework Core 2.0 (2.0.0-preview2-final)。正式版发布时,功能可能存
- 本文实例讲述了Python实现的IP端口扫描工具类。分享给大家供大家参考,具体如下:去年服务器老是被攻击,每次上线之后,上线的人急急忙忙下班
- 为了防止再次被攻击,做个验证码过滤程序是必要的。我在网上找了一些资料,觉得用别人做好的代码总是很不爽,自己做麻又不会写复杂的代码,特别是生成
- RSS 是一种基于 XML的文件标准,通过符合 RSS 规范的 XML文件可以简单实现网站之间的内容共享。Ajax 是Asynchronou
- argparse 模块是Python内置的用于命令项选项与参数解析的模块,可以轻松编写友好的命令行接口,能够帮助程序员为模型定义参数。传入一
- 本文实例为大家分享了python实现银行系统的具体代码,供大家参考,具体内容如下1、admin.py 定义管理员信息和主界面显示#!/usr
- 安装通过 pip 安装 Beautiful Soup 模块:pip install beautifulsoup4 。 还可以使用 PyCha
- 马上就是圣诞节了,先提前祝大家圣诞快乐!:christmas_tree::christmas_tree::christmas_t
- 基本使用首先要下载 pymysqlpip install pymsql以下是 pymysql 的基本使用import pymysql# 链接
- 前言有些人看到这个问题觉得不是问题,是嘛,不就是df.col[]函数嘛,其实忽略了一个重点,那就是我们要省去把csv文件全部读取这个过程,因
- 一道Python面试题的几种解答: 两个元祖T1=('a', 'b'), T2=('c',
- 前言需要注意,对实例化的文本组件的insert、delete等操作的index**都是浮点型而不是整型**,(1.0,2.0)表示的是对第一
- 关于break/continue这两个关键字在平常的使用过程中一直比较迷糊。好不容易理解了吧,过段时间不使用好像忘记了什么。这个问题也是很多
- 今天我和中国著名画家"渔人"谈了一个关于"怎样才能设计好"的问题,他给我说了一句话,得益不浅,那句话
- 因为最近在做深度学习抠图,正好要用到蒙版进行抠图,所以我将抠图代码进行了封装注释,可以直接使用。可能走了弯路,若有高见请一定提出!主要代码i
- 首先我们来安装python1、首先进入网站下载:点击打开链接(或自己输入网址https://www.python.org/downloads
- 1 如何创建项目数据库首先,在虚拟机数据库中建立一个与项目同名的数据库,方便管理。(django_test) bd@DF:~$ mysql
- create proc addcolumn@tablename varchar(30), --表名@colname varchar(30),