[comp.windows.ms] CPU Usage of Word for Windows, PC-PLUS

shwake@raysnec.UUCP (Ray Shwake) (03/27/91)

	Just pulled an interesting utility off our organization's BBS
which monitors CPU usage under Windows 3.0. It's simply loaded in WIN.INI,
takes up an icon and shows the percentage. The utility is CPUUSE.EXE.

	Running from the Program Manager, usage typically shows 1-2% -
unless I'm really doing something - but if I load MS Word for Windows it
shows a typical 95-97% CPU utilization in edit/insert mode, but drops
substantially if I'm doing something else in Word. This was encountered
on a Powermate 386/20, 2 MB 32-bit RAM, 2 MB 16-bit RAM assigned as
expanded memory (for disk cache and ram disk) - thus running Standard mode.

	On another system (AST 386/33 w/4 MB) running 386 Enhanced, I
discovered that running ProComm Plus in a window pushed utilization up to
~70%! Closing the window usually brought that usage down to normal.

	Is CPUUSE giving false information, or has it revealed a real
problem? Has anyone run that utility with other such applications?

-----------  
uunet!media!ka3ovk!raysnec!shwake				shwake@rsxtech

daneman@czech.sw.mcc.com (Michael Daneman) (03/27/91)

In article <274@raysnec.UUCP> shwake@raysnec.UUCP (Ray Shwake) writes:
> 
> 	Running from the Program Manager, usage typically shows 1-2% -
> unless I'm really doing something - but if I load MS Word for Windows it
> shows a typical 95-97% CPU utilization in edit/insert mode, but drops
> 	On another system (AST 386/33 w/4 MB) running 386 Enhanced, I
> discovered that running ProComm Plus in a window pushed utilization up to
> ~70%! Closing the window usually brought that usage down to normal.
> 
> 	Is CPUUSE giving false information, or has it revealed a real
> problem? Has anyone run that utility with other such applications?

These number actually sound reasonable to me.  MS Word is a pretty power
hungry application.  It's CPU usage might drop in 386 enhance mode, but I
am not sure about that.  As far a ProComm goes, running a DOS application in
a window takes a lot of CPU time because Windows has to virtualize the
text screen (where procomm normally write), convert that screen to a
graphic bitmap and dump that bitmap to the screen at regular intervals.
Running DOS applications full screen takes considerably less CPU time.


-- 
---------------------------------------------------------------------
       "No clever quote available today."
                                      -Mike.

jseidman@jarthur.Claremont.EDU (Jim Seidman) (03/29/91)

shwake@raysnec.UUCP (Ray Shwake) writes:
>[about results from CPU Usage Meter:]
>	Running from the Program Manager, usage typically shows 1-2% -
>unless I'm really doing something - but if I load MS Word for Windows it
>shows a typical 95-97% CPU utilization in edit/insert mode, but drops
>substantially if I'm doing something else in Word.

As the author of CPU Usage, I can guess what's going on.  Usually pretty
much nothing is happening when you're not interacting with the system
because Windows apps are message-based.  However, in some cases programs,
for some reason or another, need to enter a background-processing or polling-
like mode.  In this case, they will take up pretty much all the CPU time
in a tight loop.

>	On another system (AST 386/33 w/4 MB) running 386 Enhanced, I
>discovered that running ProComm Plus in a window pushed utilization up to
>~70%! Closing the window usually brought that usage down to normal.

Dos boxes in 386Enh are very inefficient to start with.  ProComm sits
just polling for input when it's not doing anything, so it's particularly
bad, since Windows can't detect that it's idle.  (If usage doesn't return to
normal when you exit, it's because of a known bug in CPUUSE.  Closing it
and starting it up again will solve the problem.)

-- 
Jim Seidman, Headland Technology, 46221 Landing Parkway, Fremont CA 94538
"It doesn't need to work.  They'll be paralyzed laughing at me."
							- The Doctor, "Shada"

press@venice.SEDD.TRW.COM (Barry Press) (04/11/91)

In article <4983@czech.sw.mcc.com> daneman@czech.sw.mcc.com (Michael Daneman) writes:
>In article <274@raysnec.UUCP> shwake@raysnec.UUCP (Ray Shwake) writes:
>> 
>> 	Running from the Program Manager, usage typically shows 1-2% -
>> unless I'm really doing something - but if I load MS Word for Windows it
>> shows a typical 95-97% CPU utilization in edit/insert mode, but drops
>
>These number actually sound reasonable to me.  MS Word is a pretty power
>hungry application.  It's CPU usage might drop in 386 enhance mode, but I
>am not sure about that.  As far a ProComm goes, running a DOS application in
>a window takes a lot of CPU time because Windows has to virtualize the
>text screen (where procomm normally write), convert that screen to a
>graphic bitmap and dump that bitmap to the screen at regular intervals.
>Running DOS applications full screen takes considerably less CPU time.

It's somewhat more complicated than that.  The API for the comm ports in
Windows does not provide a message that says "you've got characters to
process", although it does provide interrupt driven, buffered comm.
The implication of this is that a Windows comm program has to continually
poll to see if there's anything in the input buffer.  There are two
ways to do that:

1.	You can set a timer, and every time the timer expires, check the
	buffer.

2.	You can use a call that checks for input messages in the application's
	queue but returns whether or not messages are present.  In the
	same loop, you check the comm buffer.

The net result of these two approaches is that, although the CPU per check is
low and other programs get lots of opportunity to run, if your system is idle
then the comm program can suck up quite a bit of CPU doing the polling.

-- 
Barry Press                                 Internet: press@venice.sedd.trw.com