Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共4 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:[原创]数据库与全局变量读写性能测试

1楼
z7c9 发表于:2011/1/13 18:15:27

以下内容为程序代码:

1 runmode:1;
2
3 starttime:=timetot0(currenttime);
4
5 for i=1 to 5000 do begin
6     extgbdataset(numtostr(i,0),i);
7 end
8
9 endtime:=timetot0(currenttime);
10
11 msgout(1,'extgbdata write time : '+numtostr(endtime-starttime,0));
12

 

 

以下内容为程序代码:

1 runmode:1;
2
3 starttime:=timetot0(currenttime);
4
5 for i=1 to 5000 do begin
6     debugfile('c:\extgbdata.txt',numtostr(extgbdata(numtostr(i,0)),0),0);
7 end
8
9 endtime:=timetot0(currenttime);
10
11 msgout(1,'extgbdata write time : '+numtostr(endtime-starttime,0));

 

 

以下内容为程序代码:

1 runmode:1;
2
3 starttime:=timetot0(currenttime);
4
5 database('provider=microsoft.jet.oledb.4.0;data source=test.mdb');
6
7 for i=1 to 5000 do begin
8     sql:='insert into test(key1,value1) values("'+numtostr(i,0)+'",'+numtostr(i,0)+')';    
9     dbexecute(sql);
10 end
11
12 endtime:=timetot0(currenttime);
13
14 msgout(1,'database write time : '+numtostr(endtime-starttime,0));
15

 

 

以下内容为程序代码:

1 runmode:0;
2
3 starttime:=timetot0(currenttime);
4
5 database('provider=microsoft.jet.oledb.4.0;data source=test.mdb');
6
7 for i=1 to 5000 do begin
8     sql:='select * from test where key1='+numtostr(i,0);    
9     msgout(1,sql);
10     dbtable2(sql);
11     value:=dbvalue('value1');    
12     debugfile('c:\database.log',numtostr(value,0),0);
13 end
14
15 endtime:=timetot0(currenttime);
16
17 msgout(1,'database write time : '+numtostr(endtime-starttime,0));
18

2楼
paulshen 发表于:2011/8/16 22:07:05

不错,很能说明问题。

[此贴子已经被作者于2011-8-16 22:07:13编辑过]
3楼
王锋 发表于:2011/8/16 23:01:13
debugfile 和 msgout 很消耗CPU资源,要把他们考虑进去
4楼
阿火 发表于:2011/8/17 7:52:52

我觉得

extgbdata 和 一般的变量  读写速度没什么区别

数据库的读写速度会慢点吧

共4 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.24609 s, 3 queries.