[gst-devel] 0.9 proposals

David Schleef ds at schleef.org
Fri Dec 3 18:02:01 CET 2004


On Fri, Dec 03, 2004 at 07:00:47PM +0100, Martin Soto wrote:
> > Yes.  Profiling by using 'time' is a shot in the dark, at best.
> 
> OK, now I'm using getrusage to get the resource usage information.

Use gettimeofday(), test on a quiet machine, and redirect any
output to a file or /dev/null.  This tests the total elapsed time,
which is really the only interesting bit.  If you make the assumption
that the CPU is working 100% on your process, it's pretty accurate.
(And this is a reasonable assumption, if you minimize distractions.)

> How big the effect of this can be on the
> general performance of a pipeline, I don't know, but there seems to be a
> clear performance difference.

Thanks for taking the time to actually measure this.

Assuming a frame rate of 50 fps, and about 5 threads in a typical
pipeline (scheduled by opt), one would estimate about 250 context
switches per second.  At 2.5 us per switch, you end up with about
0.0625% of the cpu going to context switches.  I *so* don't care
about trying to improve this.  In fact, I'm going to oppose this
on principle that it specifically _should not_ be optimized.



dave...





More information about the gstreamer-devel mailing list