[comp.sys.mac.misc] Speed Increase in Background? How did that happen?

dbert@churchy.gnu.ai.mit.edu (Douglas Siebert) (04/08/91)

In article <040791.170833BRBOYER@MTUS5.CTS.MTU.EDU> BRBOYER@MTUS5.CTS.MTU.EDU (Rucell) writes:
>
>   I have a question for all of you Macintosh Guru's.  What on Earth could
>make a program run faster in the background than it does in the fore-ground
>(while Multi-Finder is activated)?  When I first noticed the severe speed
>differences, I almost freaked out.  Could someone explain this to me?  Is
>there a way to get my program to run the same speed (or even faster) while it
>is in the fore-ground?  Thanks in advance...
>
I'm no Mac guru, and you don't mention which program is involved here, but I
will bet that it is one of two things:

1)  The program has a lot of screen updating to do that it doesn't have to
    while run in the background, or...

2)  You are running the program on a Mac si or ci using the built-in video
    circuitry (and a lot of colors also, I'd guess)  If the program while in
    the foreground normally resides in the area also used for the bitmap, you
    will notice it running much slower than when it is in the background (and
    presumably another program has been started before it and is occupying the
    bitmap area, thereby making *that* program run slower.

3)  Hope this helps.


--
Doug Siebert                    |                dbert@gnu.ai.mit.edu
MBA Student (2nd year)          |  "All opinions expressed herein are obviously
(starting MS in CS this fall?)  |   superior to yours or you wouldn't have need
The University of Iowa          |   to be reading this, now would you?"  :-)

time@ice.com (Tim Endres) (04/13/91)

In article <1991Apr7.214847.942@mintaka.lcs.mit.edu>, dbert@churchy.gnu.ai.mit.edu (Douglas Siebert) writes:
> >
> >   I have a question for all of you Macintosh Guru's.  What on Earth could
> >make a program run faster in the background than it does in the fore-ground
> >(while Multi-Finder is activated)?  When I first noticed the severe speed
> >differences, I almost freaked out.  Could someone explain this to me?  Is
> >there a way to get my program to run the same speed (or even faster) while it
> >is in the fore-ground?  Thanks in advance...
> >
> I'm no Mac guru, and you don't mention which program is involved here, but I
> will bet that it is one of two things:

Isn't it also possible that the program uses different "wait ticks"
in the WaitNextEvent() call in foreground and background?

I know a couple programs that give more time to WNE when they are
in the foreground, since they "have control" in the foreground and
can intelligently "plan" their activity, whereas in the background,
they want the CPU more frequently to get stuff done that they "put
off" when they are in the background. In other words, they give up
the CPU more in the background, and only do the CPU intensive when
other apps give up the time.

Reminds me of RPN...

tim.

-------------------------------------------------------------
Tim Endres                |  time@ice.com
ICE Engineering           |  uupsi!ice.com!time
8840 Main Street          |  Voice            FAX
Whitmore Lake MI. 48189   |  (313) 449 8288   (313) 449 9208