Mail Archives: djgpp/1997/06/25/04:15:10

Date: Wed, 25 Jun 1997 11:13:36 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Leendert Combee <combee AT cambridge DOT scr DOT slb DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: profiling...
In-Reply-To: <>
Message-ID: <Pine.SUN.3.91.970625110644.10784I-100000@is>
MIME-Version: 1.0

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.)

- Raw text -

  webmaster     delorie software   privacy  
  Copyright 2019   by DJ Delorie     Updated Jul 2019