forsn=0to5
ttt1=now()
i=0
dowhilei<=100000
i=i+1
loop
ttt2=now()
tou=ttt2-ttt1
Response.Writesn&"、"&tou*24*60*60&"<br>"
next
forsn=0to5
ttt1=now()
ii=0
fori=0to100000
ii=ii+1
next
ttt2=now()
tou=ttt2-ttt1
Response.Writesn&"、"&tou*24*60*60&"<br>"
next
%>
界说5000个一个字符的SESSION其实不比界说5000个有5000个字符串长的SESSION少花良多工夫,二者工夫差仅为近一倍,用一秒多钟。却是天生这个5000个字符长的变量花了很多的工夫,<%
dimtttt1,ttt2
c="a"
forsn=0to5
session.abandon
ttt1=now()
fori=0to5000
session("s"&i)=c
next
ttt2=now()
tou=ttt2-ttt1
Response.Writesn&"、"&tou*24*60*60&":"&session("s"&i-1)&"<br>"
next
fori=0to5000
c="a"&c
next
forsn=0to5
session.abandon
ttt1=now()
fori=0to5000
session("s"&i)=c
next
ttt2=now()
tou=ttt2-ttt1
Response.Writesn&"、"&tou*24*60*60&":"&session("s"&i-1)&"<br>"
next
%>
这段程序从SN=3起就很慢,而后面十分快
<!--#includefile="filetou.asp"-->
<%
dimtttt1,ttt2
forsn=0to5
ttt1=now()
fori=1to20
sql="SELECT称号fromuserwhere称号=阿余"
Setrs=Server.CreateObject("ADODB.RecordSet")
rs.Opensql,conn,1,3
rs("称号")="阿余"
rs.update
rs.close
next
ttt2=now()
tou=ttt2-ttt1
Response.Writesn&"、"&tou*24*60*60&":"&session("s"&i-1)&"<br>"
next
%>
而如许就快多了。看来建工具很要花些工夫,另有,用MOVE0,1和MOVEFIRST比拟速率没有甚么不同。
<!--#includefile="filetou.asp"-->
<%
sql="SELECT称号fromuserwhere称号=阿余"
Setrs=Server.CreateObject("ADODB.RecordSet")
rs.Opensql,conn,1,3
dimtttt1,ttt2
forsn=0to5
ttt1=now()
fori=1to700
rs("称号")="阿余"
rs.update
rs.movefirst
next
ttt2=now()
tou=ttt2-ttt1
Response.Writesn&"、"&tou*24*60*60&":"&session("s"&i-1)&"<br>"
next
%>
forsn=0to5
ttt1=now()
fori=1to700
rs("称号")="阿余"
rs.update
rs.movefirst
next
ttt2=now()
tou=ttt2-ttt1
Response.Writesn&"、"&tou*24*60*60&":"&session("s"&i-1)&"<br>"
next
forsn=0to5
ttt1=now()
fori=1to700
SQL="UPDATEuserset称号=阿余where称号=阿余"
conn.executesql,0,-1
next
ttt2=now()
tou=ttt2-ttt1
Response.Writesn&"、"&tou*24*60*60&":"&session("s"&i-1)&"<br>"
next