Having a performance issue for this code. Is this normal or not?

조회 수: 8 (최근 30일)
Scotty
Scotty 2012년 11월 12일
here is the code I am experiencing a performance slowdown with, I have tested is vs my home pc (Win7 x64 8gb, and WinXP x32 4gb)and both outperformed. What gives?
Note: the files I am copying are flat files of the fuill history for each ticker. With the largest file being 840kb and only 115 files over 350kb. And the total file list;
>> size(tickers)
ans =
3408.00
tic
for i = 1:length(tickers)
copyfile(strcat('C:\data\temp\', tickers{i}, 'yahoo.txt'), 'C:\data\yahoo\');
fprintf('Finished copying %s ...\n',tickers{i});
end
toc
Elapsed time is 111.649063 seconds
  • System Specs:
  • Windows Windows 7 Professional Edition (64-bit) Service Pack 1 (Build 7601)
  • Memory (RAM) 4062 MB
  • CPU Info Intel® Xeon® CPU E31270 @ 3.40GHz
  • CPU Speed 3392.4 MHz
  • Manufacturer * HP
  • Product Make * ProLiant DL120 G7

답변 (1개)

Jan
Jan 2012년 11월 12일
편집: Jan 2012년 11월 12일
Size will surely not reply a floating point number, except if you have shadowed the built-in function by a local variable:
size = rand(10);
tickers = 5;
size(tickers)
You want to copy 3400 files of about 500kB. This means reading writing 1.7GB. When reading and writing happens on the same disk, you can expect the time of writing 3.4GB. When the disk is fragmented, or if it is network drive, 111 seconds are not completely mad.
You mention, that you see a slowdown. Then please explain if you see it between Matlab versions, operating systems, different disks or growing over time, and in the last case, if "time" means minuts, hours, weeks or years. In addition it is important to mention the Matlab version you are using. E.g. old version of Matlab have opened a DOS box to copy files - bad idea.
Please check if the virus checker occupies a lot of computing power during the processing.
You see an extremely slow file handling e.g. short before the final collapse of a hard disk. So please check the disk.
  댓글 수: 5
Jan
Jan 2012년 11월 13일
As shown in my profile page I'm working in Heidelberg, Germany.
Scotty
Scotty 2012년 11월 13일
Saw that right after I replied... nice place I have been there.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by