最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
程序运行速度测试
时间:2022-06-30 11:25:46 编辑:袖梨 来源:一聚教程网
程序运行速度试验结果:
1。作相同的分支条件判断:IF 比 SELECT慢。
用以下程序测试:
<%
dim tttt1,ttt2
session("ii")=0
for sn=0 to 5
ttt1=now()
for i=0 to 300000
if session("ii")=0 then
session("ii")=1
else
if session("ii")=1 then
session("ii")=2
else
if session("ii")=2 then
session("ii")=3
else
session("ii")=0
end if
end if
end if
next
ttt2=now()
tou=ttt2-ttt1
Response.Write sn&"、"&tou*24*60*60&"
"
next
for sn=0 to 5
ttt1=now()
for i=0 to 300000
select case session("ii")
case 0
session("ii")=1
case 1
session("ii")=2
case 2
session("ii")=3
case 3
session("ii")=0
end select
next
ttt2=now()
tou=ttt2-ttt1
Response.Write sn&"、"&tou*24*60*60&"
"
next
%>
2, 如果把上例中的SESSION对象改为用普通的变量存。速度会快差不多8倍
3,进行字符串连接时往中间加入相同多的字符串,基数越大,越慢。
通过下面的程序测试:
<%
dim tttt1,ttt2
session("ii")=0
for sn=0 to 5
ttt1=now()
' txt=""
1。作相同的分支条件判断:IF 比 SELECT慢。
用以下程序测试:
<%
dim tttt1,ttt2
session("ii")=0
for sn=0 to 5
ttt1=now()
for i=0 to 300000
if session("ii")=0 then
session("ii")=1
else
if session("ii")=1 then
session("ii")=2
else
if session("ii")=2 then
session("ii")=3
else
session("ii")=0
end if
end if
end if
next
ttt2=now()
tou=ttt2-ttt1
Response.Write sn&"、"&tou*24*60*60&"
"
next
for sn=0 to 5
ttt1=now()
for i=0 to 300000
select case session("ii")
case 0
session("ii")=1
case 1
session("ii")=2
case 2
session("ii")=3
case 3
session("ii")=0
end select
next
ttt2=now()
tou=ttt2-ttt1
Response.Write sn&"、"&tou*24*60*60&"
"
next
%>
2, 如果把上例中的SESSION对象改为用普通的变量存。速度会快差不多8倍
3,进行字符串连接时往中间加入相同多的字符串,基数越大,越慢。
通过下面的程序测试:
<%
dim tttt1,ttt2
session("ii")=0
for sn=0 to 5
ttt1=now()
' txt=""
相关文章
- 《魔兽世界》缴械行动任务完成方法 04-27
- 《重装岚影》特色内容介绍 04-27
- 《崩坏星穹铁道》新手0氛开服必养角色推荐 04-27
- 《魔兽世界》吃鸡模式最厉害技能介绍 04-27
- 《百英雄传》莫罗乌斯位置介绍 04-27
- 《csgo》玉麒麟个人简介介绍 04-27