今天在做一个程序性能提升时发现otl_stream.第一个参数buffer size 对性能影响很大,以下是几个测试数据.
参考: http://otl.sourceforge.net/otl3_stream_class.htm
50 2.06
<1:536704> 18:31:58.068 [00001] The load SQL is [select USER_NUMBER from dr_gsm_931_20050831 where 1=1 ]
<1:536704> 18:34:04.713 [00001] There are 3612066 records is loaded!
100 1.38
<1:2085112> 18:36:23.727 [00001] The load SQL is [select USER_NUMBER from dr_gsm_931_20050831 where 1=1 ]
<1:2085112> 18:38:01.923 [00001] There are 3612066 records is loaded!
1.23
<1:2085112> 18:38:06.941 [00001] The load SQL is [select USER_NUMBER from dr_gsm_931_20050831 where 1=1 ]
<1:2085112> 18:39:29.849 [00001] There are 3612066 records is loaded!
200 1.02
<1:1499250> 18:41:47.711 [00001] The load SQL is [select USER_NUMBER from dr_gsm_931_20050831 where 1=1 ]
<1:1499250> 18:42:49.300 [00001] There are 3612066 records is loaded!
<1:1499250> 18:42:54.312 [00001] The load SQL is [select USER_NUMBER from dr_gsm_931_20050831 where 1=1 ]
<1:1499250> 18:43:53.717 [00001] There are 3612066 records is loaded!
500 0.43
<1:1978536> 18:45:57.790 [00001] The load SQL is [select USER_NUMBER from dr_gsm_931_20050831 where 1=1 ]
<1:1978536> 18:46:40.685 [00001] There are 3612066 records is loaded!
<1:1978536> 18:45:09.982 [00001] The load SQL is [select USER_NUMBER from dr_gsm_931_20050831 where 1=1 ]
<1:1978536> 18:45:52.787 [00001] There are 3612066 records is loaded!
1000 0.35
<1:1597632> 18:47:42.973 [00001] The load SQL is [select USER_NUMBER from dr_gsm_931_20050831 where 1=1 ]
<1:1597632> 18:48:17.715 [00001] There are 3612066 records is loaded!
<1:1597632> 18:48:22.718 [00001] The load SQL is [select USER_NUMBER from dr_gsm_931_20050831 where 1=1 ]
<1:1597632> 18:49:01.119 [00001] There are 3612066 records is loaded!
<1:1597632> 18:51:17.837 [00001] The load SQL is [select USER_NUMBER from dr_gsm_931_20050831 where 1=1 ]
<1:1597632> 18:51:24.416 [10001] Signal 31 recieved.
<1:1597632> 18:49:49.976 [00001] The load SQL is [select USER_NUMBER from dr_gsm_931_20050831 where 1=1 ]
<1:1597632> 18:50:28.192 [00001] There are 3612066 records is loaded!
2000 0.34
<1:2883830> 18:51:47.365 [00001] The load SQL is [select USER_NUMBER from dr_gsm_931_20050831 where 1=1 ]
<1:2883830> 18:52:21.163 [00001] There are 3612066 records is loaded!
<1:2883830> 18:52:26.166 [00001] The load SQL is [select USER_NUMBER from dr_gsm_931_20050831 where 1=1 ]
<1:2883830> 18:53:01.576 [00001] There are 3612066 records is loaded!
另外,编译时定义
OTL_STREAM_POOLING_ON 也会对性能有所提升.
参考:
http://otl.sourceforge.net/otl3_ex113.htm