[gstreamer-bugs] [Bug 605594] relatively high cpu usage compared to other players
GStreamer (bugzilla.gnome.org)
bugzilla at gnome.org
Sun Jan 31 13:19:54 PST 2010
https://bugzilla.gnome.org/show_bug.cgi?id=605594
GStreamer | gstreamer (core) | 0.10.x
--- Comment #4 from Olaf Leidinger <leidola at web.de> 2010-01-31 21:19:48 UTC ---
> Please confirm that you use the same audiosinks?
They do, both use the alsa audio sink.
> Finally how is you gstreamer build. Is it a debug build or are you (or your distro) use e.g.
> CFLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CAST_CHECKS"
Using gentoo the package management compiles everything possible from source.
Therefore I used the following CFLAGS:
-march=k8 -msse -msse2 -msse3 -mssse3 -mfpmath=sse -ftree-vectorize -O2 -pipe
This is a good set of flags for my ATOM netbook. march=k8 is intentional, as it
seems to be faster than optimizing for pentium-m.
Therefore the tests were sort of a debug build. I rebuilt gstreamer using
CFLAGS=-march=k8 -msse -msse2 -msse3 -mssse3 -mfpmath=sse -ftree-vectorize -O2
-pipe -DG_DISABLE_ASSERT -DG_DISABLE_CAST_CHECKS
And added --disable-trace to the configure flags. In total they where:
--prefix=/usr --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu
--mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share
--sysconfdir=/etc --localstatedir=/var/lib --disable-static
--disable-dependency-tracking --enable-nls --disable-valgrind
--disable-examples --disable-trace --disable-tests
--with-package-name="GStreamer ebuild for Gentoo"
--with-package-origin=http://packages.gentoo.org/package/media-libs/gstreamer
###############
Here some benchmarks using this (and the old build):
Setting fakesink using playbin2 seems not to work. Therefore
I used the following:
#### gst (with asserts, async)
time gst-launch-0.10 filesrc location=tailspin.ogg ! oggdemux ! vorbisdec!
fakesink sync=false
[...]
real 0m9.168s
user 0m9.117s
sys 0m0.028s
#### gst (without asserts, async)
time gst-launch-0.10 filesrc location=tailspin.ogg ! oggdemux ! vorbisdec!
fakesink sync=false
[...]
real 0m8.963s
user 0m8.645s
sys 0m0.112s
###### As I couldn't find a switch in mplayer to disable sync output, again the
same with sync output
#### gst (with asserts, sync)
time gst-launch-0.10 filesrc location=tailspin.ogg ! oggdemux ! vorbisdec!
fakesink sync=true
[...]
real 5m17.516s
user 0m13.305s
sys 0m0.912s
#### gst (without asserts, sync)
time gst-launch-0.10 filesrc location=tailspin.ogg ! oggdemux ! vorbisdec!
fakesink sync=true
[...]
real 5m17.508s
user 0m12.185s
sys 0m0.768s
#### mplayer (null)
# And again with mplayer
time mplayer -ao null tailspin.ogg
[...]
real 5m27.494s
user 0m5.832s
sys 0m1.204s
########## And now with audio output, using playbin*
### gst (with asserts, playbin)
time gst-launch-0.10 playbin uri=file:///"`pwd`/tailspin.ogg"
[...]
real 5m18.044s
user 0m20.837s
sys 0m1.976s
### gst (with asserts, playbin2)
time gst-launch-0.10 playbin2 uri=file:///"`pwd`/tailspin.ogg"
[...]
real 5m17.955s
user 0m20.441s
sys 0m2.112s
### gst (without asserts, playbin)
time gst-launch-0.10 playbin uri=file:///"`pwd`/tailspin.ogg"
[...]
real 5m17.885s
user 0m19.021s
sys 0m1.752s
### gst (without asserts, playbin2)
time gst-launch-0.10 playbin2 uri=file:///"`pwd`/tailspin.ogg"
[...]
real 5m17.821s
user 0m21.669s # error of measurement?
sys 0m2.044s
### mplayer (alsa)
real 5m18.415s
user 0m6.788s
sys 0m1.812s
### To conclude the tests I rebuilt gstreamer, the vorbis-plugin and libvorbis
with -O3
### same options as above, but -O2 replaced (mplayer seems not to be linked
against libvorbis)
### gst (without asserts, playbin, -O3)
time gst-launch-0.10 playbin uri=file:///"`pwd`/tailspin.ogg"
[...]
real 5m18.055s
user 0m19.541s
sys 0m2.024s
### gst (without asserts, playbin2, -O3)
time gst-launch-0.10 playbin2 uri=file:///"`pwd`/tailspin.ogg"
[...]
real 5m17.800s
user 0m18.617s
sys 0m1.996s
### To find out if playbin* are slow, I constructed the following pipeline
time gst-launch-0.10 filesrc location=tailspin.ogg ! oggdemux ! vorbisdec!
audioconvert ! alsasink
[...]
real 5m17.648s
user 0m14.501s
sys 0m1.012s
# Table of results:
[seconds] | w ass. | wo ass.
--------------------------------------
fakesink, async | 9.117 | 8.645
fakesink, sync | 13.305 | 12.185
playbin | 20.837 | 19.021
playbin2 | 20.441 | 21.669
playbin -O3 | --- | 19.541
playbin2 -O3 | --- | 18.617
alsasink -O3 | --- | 14.501
mplayer null | 5.832
mplayer alsa | 6.788
[%] cpu time/
runtime *100 | w ass. | wo ass.
--------------------------------------
fakesink, async | 99.4 | 96.5
fakesink, sync | 4.2 | 3.8
playbin | 6.6 | 6.0
playbin2 | 6.4 | 6.8
playbin -O3 | --- | 6.1
playbin2 -O3 | --- | 5.9
alsasink -O3 | --- | 4.6
mplayer null | 1.8
mplayer alsa | 2.1
Conclusion:
- Using -O3 doesn't bring much more performance
- Playbin has overhead!
- The asserts have also a noticeable overhead
--
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the Gstreamer-bugs
mailing list