Date: Wed, 25 Jun 1997 11:13:36 +0300 (IDT) From: Eli Zaretskii To: Leendert Combee cc: djgpp AT delorie DOT com Subject: Re: profiling... In-Reply-To: <199706250723.IAA04387@tartan.scr.slb.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Wed, 25 Jun 1997, Leendert Combee wrote: > - my code does some I/O and takes a while to execute. I know much > of the time is spent in the I/O. However, it doesnot show up > in the djgpp profile data. In fact, profile data says a total execution > time of a few seconds while my code runs for a minute or so. > Profile results for other bits of my code seem OK, only the I/O > bit seems to be wrong... Any ideas here? The profile data on > unix gcc are OK for I/O and total. Do you see the library functions `__dpmi_int' and `__dj_movedata' on your profile? If so, they are the ones who call the real-mode DOS services, and so whenever the program counter dwells inside them, your program is in real mode doing I/O. Chapters 13 and 14 of the FAQ tell more on related issues. Also, please be sure to patch your library as explained in section 13.2 of the FAQ; the bug that it mentions could totally screw up the profile if not wedge your system. > I see the harddisk is accessed all the time (not swapping/paging!, just > 1000x file i/o); however, if I run the code from a dosbox/win95 (same > machine etc) I only see a harddisk access once and that's it. It still > takes about the same time to execute. > I don't have smartdrive etc installed. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ And therein lies the reason. When you boot Windows 95 it installs its own protected-mode disk cache, whereas in DOS you don't have any cache installed. Install smartdrv for DOS mode only, and you will see similar behavior. (Windows' cache is still about twice as fast as smartdrv, so some difference will remain.)