Click here to Skip to main content
15,895,557 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: ReadFile() Problem Pin
David Crow31-Jan-11 4:55
David Crow31-Jan-11 4:55 
AnswerRe: ReadFile() Problem Pin
Cedric Moonen31-Jan-11 4:47
Cedric Moonen31-Jan-11 4:47 
GeneralRe: ReadFile() Problem Pin
goldenrose931-Jan-11 6:01
goldenrose931-Jan-11 6:01 
GeneralRe: ReadFile() Problem Pin
goldenrose931-Jan-11 18:43
goldenrose931-Jan-11 18:43 
GeneralRe: ReadFile() Problem Pin
Cedric Moonen31-Jan-11 20:17
Cedric Moonen31-Jan-11 20:17 
GeneralRe: ReadFile() Problem Pin
goldenrose931-Jan-11 20:59
goldenrose931-Jan-11 20:59 
GeneralRe: ReadFile() Problem Pin
Cedric Moonen31-Jan-11 21:05
Cedric Moonen31-Jan-11 21:05 
QuestionHDD access chaotic speed problem. Pin
progDes31-Jan-11 2:06
progDes31-Jan-11 2:06 
Hi,
Using C++, std::fstream, Windows.

I have an algorithm that processes large file (actually this is the series of algorithms, but lets consider only one, cause others having the same problems).
In general this algorithm reads chunks of data from one file and write to the other file with during some realignment (For reference, I'm doing realignment of the 3d volume data). I'm reading chunk size is 512 bytes, writing chunk size is 16 kb.

Usually this algorithm finishes in 1 minute and 50 seconds. But I noticed that sometimes (rarely) it finishes in 24 seconds! Processing the same file, the same execution path. I've started to search for the reasons of why this slowdown is happening and how can I control that.

1) I have tried increasing the coalescing of the accesses to disk
2) I have considered the fragmentation problem (the file that I write is wrote in small chunks, therefore it's fragmented, about 600 fragments). When I resolved fragmentation problem (so, it's guaranteed that file is not fragmented) - I didnt got anything, still this chaotic access speed.
3) I have investigated the probability, that Windows flashes my memory buffers to HDD. No, that's not the case.
4) I have found that if I do all this operation on the other physical disk (not the one with OS) - I get this slow down more rarely, and algorithm usually finishes in 40 seconds (but anyway, speed is of HDD access is chaotic).

Frequently during the same execution, access speed is rising or falling down, may be few times.
This looks like my accesses are going out of tact with some internal HDD or OS operations, don't know.

Anyone, have some experience or idea?

Thanks.
AnswerRe: HDD access chaotic speed problem. Pin
User 742933831-Jan-11 2:35
professionalUser 742933831-Jan-11 2:35 
GeneralRe: HDD access chaotic speed problem. Pin
progDes31-Jan-11 2:49
progDes31-Jan-11 2:49 
AnswerRe: HDD access chaotic speed problem. Pin
User 742933831-Jan-11 2:59
professionalUser 742933831-Jan-11 2:59 
GeneralRe: HDD access chaotic speed problem. Pin
progDes31-Jan-11 3:36
progDes31-Jan-11 3:36 
GeneralRe: HDD access chaotic speed problem. Pin
User 742933831-Jan-11 3:39
professionalUser 742933831-Jan-11 3:39 
GeneralRe: HDD access chaotic speed problem. Pin
progDes31-Jan-11 2:51
progDes31-Jan-11 2:51 
QuestionRe: HDD access chaotic speed problem. Pin
David Crow31-Jan-11 2:54
David Crow31-Jan-11 2:54 
AnswerRe: HDD access chaotic speed problem. Pin
Andrew Brock31-Jan-11 3:04
Andrew Brock31-Jan-11 3:04 
GeneralRe: HDD access chaotic speed problem. Pin
progDes31-Jan-11 3:39
progDes31-Jan-11 3:39 
AnswerRe: HDD access chaotic speed problem. Pin
Niklas L31-Jan-11 21:09
Niklas L31-Jan-11 21:09 
GeneralRe: HDD access chaotic speed problem. Pin
progDes31-Jan-11 21:28
progDes31-Jan-11 21:28 
Questionwant to know meaning of line obj = ( struct xyz * ) ( buffer + offset ); Pin
VCProgrammer31-Jan-11 0:26
VCProgrammer31-Jan-11 0:26 
AnswerRe: want to know meaning of line obj = ( struct xyz * ) ( buffer + offset ); Pin
User 742933831-Jan-11 0:38
professionalUser 742933831-Jan-11 0:38 
GeneralRe: want to know meaning of line obj = ( struct xyz * ) ( buffer + offset ); Pin
Niklas L31-Jan-11 1:08
Niklas L31-Jan-11 1:08 
GeneralRe: want to know meaning of line obj = ( struct xyz * ) ( buffer + offset ); Pin
Graham Shanks31-Jan-11 2:24
Graham Shanks31-Jan-11 2:24 
AnswerRe: want to know meaning of line obj = ( struct xyz * ) ( buffer + offset ); Pin
Graham Shanks31-Jan-11 2:40
Graham Shanks31-Jan-11 2:40 
QuestionTransparent Color Pin
john563231-Jan-11 0:06
john563231-Jan-11 0:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.