From: Rahul on 18 Feb 2010 07:20 Hi All, My application writes data in a file using fopen/fwrite/fclose and immediately after fclose I try to open the same file using. the windows CreateFile() function. In one of my machine all are very fast and the total process finishes in < 4 seconds. But on one machine fclose itself takes around 15 seconds, I tried using setbuf(fp, NULL) and calling fflush(fp) after every write, but then also fclose took 15 seconds. I also tried using the low level functions _open, _close etc. but there also the _close took 15 second of time. What is more strange to me is that there is one more machine on which fopen/fwrite/fclose works quite fast but the last CreateFile() call takes > 15 seconds to open the same file. Is thee any way of debugging such machine specific issues. All the machine have same OS (win XP SP3 and exactly the same windows updates). The only difference is in the hardware i.e. CPU, hard disk, RAM configuration all are different. But I could not find any clue about where to look at. Could somebody please tell me about how do I go debugging such problems, Is the delay caused by the OS or the Hard disk device driver or something else? Thanks in advance Rahul
From: Ismo Salonen on 18 Feb 2010 07:44 Rahul wrote: > Hi All, > > My application writes data in a file using fopen/fwrite/fclose and > immediately after fclose I try to open the same file using. the > windows CreateFile() function. > In one of my machine all are very fast and the total process finishes > in < 4 seconds. > > But on one machine fclose itself takes around 15 seconds, I tried > using setbuf(fp, NULL) and calling fflush(fp) after every write, but > then also fclose took 15 seconds. I also tried using the low level > functions _open, _close etc. but there also the _close took 15 second > of time. > > What is more strange to me is that there is one more machine on which > fopen/fwrite/fclose works quite fast but the last CreateFile() call > takes > 15 seconds to open the same file. > > Is thee any way of debugging such machine specific issues. All the > machine have same OS (win XP SP3 and exactly the same windows > updates). The only difference is in the hardware i.e. CPU, hard disk, > RAM configuration all are different. But I could not find any clue > about where to look at. > Could somebody please tell me about how do I go debugging such > problems, Is the delay caused by the OS or the Hard disk device driver > or something else? > > Thanks in advance > Rahul Are you using local disks in all computers ? Then you could check disk throughput with hdtune . br ismo
From: Francois PIETTE on 18 Feb 2010 07:51 > My application writes data in a file using fopen/fwrite/fclose and > immediately after fclose I try to open the same file using. the > windows CreateFile() function. > In one of my machine all are very fast and the total process finishes > in < 4 seconds. > > But on one machine fclose itself takes around 15 seconds, I tried > using setbuf(fp, NULL) and calling fflush(fp) after every write, but > then also fclose took 15 seconds. I also tried using the low level > functions _open, _close etc. but there also the _close took 15 second > of time. > > What is more strange to me is that there is one more machine on which > fopen/fwrite/fclose works quite fast but the last CreateFile() call > takes > 15 seconds to open the same file. Look for so called "security product". For example an antivirus program may be buggy and tak a lot of time processing the data. Also have a look at disk fragmentation and bad sectors. On the computer experiencing slow response, does other software suffer from the same problem or is this specific to one application ? -- francois.piette(a)overbyte.be The author of the freeware multi-tier middleware MidWare The author of the freeware Internet Component Suite (ICS) http://www.overbyte.be
From: Rahul on 18 Feb 2010 08:31 On Feb 18, 5:44 pm, Ismo Salonen <i...(a)codeit.fi> wrote: > Rahul wrote: > > Hi All, > > > My application writes data in a file using fopen/fwrite/fclose and > > immediately after fclose I try to open the same file using. the > > windows CreateFile() function. > > In one of my machine all are very fast and the total process finishes > > in < 4 seconds. > > > But on one machine fclose itself takes around 15 seconds, I tried > > using setbuf(fp, NULL) and calling fflush(fp) after every write, but > > then also fclose took 15 seconds. I also tried using the low level > > functions _open, _close etc. but there also the _close took 15 second > > of time. > > > What is more strange to me is that there is one more machine on which > > fopen/fwrite/fclose works quite fast but the last CreateFile() call > > takes > 15 seconds to open the same file. > > > Is thee any way of debugging such machine specific issues. All the > > machine have same OS (win XP SP3 and exactly the same windows > > updates). The only difference is in the hardware i.e. CPU, hard disk, > > RAM configuration all are different. But I could not find any clue > > about where to look at. > > Could somebody please tell me about how do I go debugging such > > problems, Is the delay caused by the OS or the Hard disk device driver > > or something else? > > > Thanks in advance > > Rahul > > Are you using local disks in all computers ? Then you could check > disk throughput with hdtune . > > br > ismo Hi Ismo, I checked dis throughput using DskSpeed, there was not much difference in that
From: Rahul on 18 Feb 2010 08:34
On Feb 18, 5:51 pm, "Francois PIETTE" <fpie...(a)newsgroups.nospam> wrote: > > My application writes data in a file using fopen/fwrite/fclose and > > immediately after fclose I try to open the same file using. the > > windows CreateFile() function. > > In one of my machine all are very fast and the total process finishes > > in < 4 seconds. > > > But on one machine fclose itself takes around 15 seconds, I tried > > using setbuf(fp, NULL) and calling fflush(fp) after every write, but > > then also fclose took 15 seconds. I also tried using the low level > > functions _open, _close etc. but there also the _close took 15 second > > of time. > > > What is more strange to me is that there is one more machine on which > > fopen/fwrite/fclose works quite fast but the last CreateFile() call > > takes > 15 seconds to open the same file. > > Look for so called "security product". For example an antivirus program may > be buggy and tak a lot of time processing the data. > Also have a look at disk fragmentation and bad sectors. > > On the computer experiencing slow response, does other software suffer from > the same problem or is this specific to one application ? > > -- > francois.pie...(a)overbyte.be > The author of the freeware multi-tier middleware MidWare > The author of the freeware Internet Component Suite (ICS)http://www.overbyte.be Hi Francois, I do not know about other softwares, but the disk is highly fragmented. however for small files the fclose/ CreateFile works pretty fast. the problem happens whiel trying to write > 5 MB files. and I always disable the antivirus before doing any performance test on the machines. Thanks & Regards |