Request与Request.Form的速度测试
发布时间:2006-10-14 3:03:46   收集提供:gaoqian
经测试:

http://www.leadbbs.com/test?name=test

Request("name")的速度是非常快的,当请求的网址是
http://www.leadbbs.com/test?时,
Request("name")的速度下降了近二十来倍.

下面是测试代码,保存为test.asp

实际中,我们的请求一般仅针对表单的post请求与地址栏的get方法请求(Requestw函数).

<%
function Requestw(str)
     Dim tmp
     tmp = Request.QueryString(str)
     If tmp = "" Then tmp = Request.Form(str)
     Requestw = tmp
end Function

dim DEF_PageExeTime1
DEF_PageExeTime1=Timer * 1000

Dim n,happy
for n = 0 to 50000
     happy = Requestw("name")
Next

Response.Write abs(CDBL(Timer)*1000 - DEF_PageExeTime1)
%>
 
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50