[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#176267: ITP: mplayer -- Mplayer is a full-featured audioand video player for UN*X like systems



On Wed, Jan 29, 2003 at 09:02:13AM +0100, Emile van Bergen wrote:
> I hate to say it, Andrew, but I must say that looking at the CPU load of
> a single process on an otherwise idle system /does/ make sense in some
> situations. And this is one of those cases.
> 
> You see, if you're playing audio or video, you'll inevitably have a
> timer somewhere that ticks if it's time to output the next frame, be it
> audio or video.
> 
> Now, if the processing code only needs a fraction of the time interval
> provided by the timer to complete its job, then the CPU load you see
> will be low, as it will be waiting for the timer to tick the rest of the
> time.

The counterpart to this is that CPU% will only be low *if* the process
sleeps for whatever time remains. Since it doesn't have to (it may get
woken up early by IO, or have something better to do with the
processing cycles, or not want to pay the cost of the context switches
needed in order to pass control back to the kernel), the value may be
artificially higher - which is what makes it useless for benchmarking
purposes.

> A CPU load pegged at 100% means that the process doesn't finish its work
> during the interval soon enough to allow it to sleep in the timer at
> all.

True as far as it goes, but this is a simple true/false test for
whether the system is "fast enough" or "not fast enough". It does not
extend to make it valid to compare two CPU% values which are less than
100% for benchmarking purposes. In addition, there is the problem that
CPU% isn't very accurate.

> You were assuming that a media player needs all the CPU it can get by
> definition. And there lies the error, IMHO.

Not quite. The assumption is that a media player can consume a greater
proportion of the processing cycles than it actually needs - any
system which adapts to varying load has this characteristic.

-- 
  .''`.  ** Debian GNU/Linux ** | Andrew Suffield
 : :' :  http://www.debian.org/ | Dept. of Computing,
 `. `'                          | Imperial College,
   `-             -><-          | London, UK

Attachment: pgp_0s9eH4SqB.pgp
Description: PGP signature


Reply to: