Re: cpu consumption calculation - why these difference ?

Pavel Machek (pavel@atrey.karlin.mff.cuni.cz)
Mon, 31 May 1999 16:54:28 +0200


Hi!

> Sorry for being so long in testing the patch, but sleeping takes a lot
> of time.
>
> Well, yes there are differences.
> Now, the second prog. gets 30% of CPU instead of 0.1%, but the first one
> gets 5% which seems closer to the reality to me.
>
> I have two others programs (still dealing with sound), one of mine which
> takes lots of CPU and deal with X at the same time (it's a sound tracker)
> and one (midas, a sound player) that is very optimized and only plays
> modules, no interactions with X, and i read the source of it, there is
> a big pentium optimized code and some tests that I do inside my loops are
> done outside in midas, so it _must_ take less cpu. But, it uses the usleep way
> (well i think, don't remember exactly) and so it had 0.1% before the patch,
> and now gets something like 40 or 50% where my program (a blocking select is
> used) gets 10%, so once again i think the patch is wrong.

There's no way for patch to be wrong. It replaces one approximation
with better one. If code does less work but faster, my counter will
show it as bigger cpu eater than it really is. Oh well. At least you
can see that that program is running!

PS: To put it other way

Old solution did sometimes say processes are running less.

My solution sometimes says processes are runninng more. [I think this
is more acceptable].

Pavel

-- 
The best software in life is free (not shareware)!		Pavel
GCM d? s-: !g p?:+ au- a--@ w+ v- C++@ UL+++ L++ N++ E++ W--- M- Y- R+

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/