Mail Archives: djgpp/1997/02/19/03:33:10
On Tue, 18 Feb 1997, SerDevian wrote:
> The thing that confuses me is that if I add a "fflush(stdout)" before
> the main graphical loop, the program speeds up by about 10 fps (80 -> 90
> fps). I figured at first that maybe having something hanging in the
> buffer caused something to be lurking in the background, slowing things
> down; but that explanation doesn't make sense within this particular
> program because I flush stdout before the main loop anyway.
A more plausible explanation might be that the changes in the code cause
your program to overflow the CPU cache, especially since you use -O3 which
causes gcc to inline everything in sight. Try disabling the caches (both
the L1 on the chip and the L2 on the motherboard) and see if that makes
both versions run at the same (much slower) speed.
> Maybe fflush() modifies the timer?
No, `fflush' doesn't do anything to the timer.
- Raw text -