[MPlayer-dev-eng] Re: Compile options

Andrew Savchenko Bircoph at list.ru
Sat Sep 16 21:43:45 CEST 2006


> Andrew Savchenko <Bircoph <at> list.ru> writes:
> > > -O4:
> > > BENCHMARKs: VC:  69.572s VO:   8.038s A:   2.032s Sys:  79.365s =
> > > 159.007s BENCHMARK%: VC: 43.7541% VO:  5.0551% A:  1.2780% Sys:
> > > 49.9129% = 100.0000%
> > >
> > > real    2m39.531s
> > > user    1m12.721s
> > > sys     0m0.652s
> > >
> > > -O2:
> > > BENCHMARKs: VC:  67.075s VO:   7.877s A:   1.984s Sys:  82.081s =
> > > 159.017s BENCHMARK%: VC: 42.1811% VO:  4.9537% A:  1.2475% Sys:
> > > 51.6176% = 100.0000%
> > >
> > > real    2m39.629s
> > > user    1m9.408s
> > > sys     0m0.680s
> >
> > I misunderstand you.
>
> Yes. Sorry about that.
>
> -O2 is 2% - 5% faster than -O4. Please try to confirm.

I've made my own test and I can't confirm your result. My test technique 
is described below.

System: AthlonXP 2500 oc 3200, 1.5 Gb RAM (dual mode)
kernel: 2.6.14-1.1653.1asp
gcc: gcc-4.0.2-8.fc4
mplayer: dev-SVN-r19848-4.0.2
ntp was disabled during testing.

Compile options:
for -O4:
OPTFLAGS = -Wdeclaration-after-statement -fno-PIC -O4 -march=athlon-xp 
-fexpensive-optimizations -mtune=athlon-xp -pipe -ffast-math 
-fomit-frame-pointer -D_REENTRANT  -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE $(EXTRA_INC)

for -O2:
OPTFLAGS = -Wdeclaration-after-statement -fno-PIC -O2 -march=athlon-xp 
-fexpensive-optimizations -mtune=athlon-xp -pipe -ffast-math 
-fomit-frame-pointer -D_REENTRANT  -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE $(EXTRA_INC)

!!! Make sure to $make distclean before recompiling MPlayer !!!

mplayer's default options (from ~/.mplayer/config; other config files 
(in etc/ and others) are absent):
vo=x11
ao=alsa,jack,
fs="1"
zoom="1"
sws=10
mc=0
autosync=30
vf=pp=ac,hue,screenshot
autoq=100
spuaa=4
font="/usr/share/fonts/default/Type1/n019003l.pfb"
subcp="cp1251"
subfont-autoscale="1"
subfont-text-scale="4.0"
subfont-osd-scale="3.5"
dr="1"
nortc="1"

Test file was high-quality short anime, about 3:11 length.

It was tested with the following command:
for -O4:
for (( i=0; i-10; i++ )); do ( echo phase $i: >> ../O4.res; 
time ./mplayer file.avi -osdlevel 3 -stop-xscreensaver >> ../O4.res 
2>&1 ); done

for -O2:
for (( i=0; i-10; i++ )); do ( echo phase $i: >> ../O2.res; 
time ./mplayer file.avi -osdlevel 3 -stop-xscreensaver >> ../O2.res 
2>&1 ); done

Test main results according to time (mplayer's -benchmark is not 
intresting for me, because the main goal was investigation of _total_ 
program speed):

for -O4:
---
real    3m11.351s
user    1m47.551s
sys     0m0.868s

real    3m11.351s
user    1m47.795s
sys     0m0.984s

real    3m11.350s
user    1m47.699s
sys     0m0.920s

real    3m11.349s
user    1m47.511s
sys     0m0.896s

real    3m11.348s
user    1m47.647s
sys     0m0.912s

real    3m11.352s
user    1m46.935s
sys     0m0.988s

real    3m11.317s
user    1m47.883s
sys     0m0.904s

real    3m11.359s
user    1m47.539s
sys     0m0.900s

real    3m11.357s
user    1m47.335s
sys     0m0.880s

real    3m11.332s
user    1m47.527s
sys     0m0.872s
---

for -O2:
---
real    3m11.353s
user    1m48.075s
sys     0m0.960s

real    3m11.349s
user    1m48.479s
sys     0m0.876s

real    3m11.316s
user    1m47.459s
sys     0m0.936s

real    3m11.374s
user    1m47.079s
sys     0m0.932s

real    3m11.352s
user    1m48.151s
sys     0m0.884s

real    3m11.347s
user    1m47.699s
sys     0m0.984s

real    3m11.352s
user    1m48.347s
sys     0m0.920s

real    3m11.349s
user    1m48.015s
sys     0m0.888s

real    3m11.349s
user    1m48.171s
sys     0m0.948s

real    3m11.346s
user    1m48.515s
sys     0m0.936s
---

Then experimental data was processed according to the rules of 
statistics, assuming normal (IOW Gaussian) distribution for results 
with appropriate statistical errors using Student cofficient for 
accuracy 0.95 (i.e. 95%) and 10 experimantal points: t(0.95,10)=2.26:

for -O4:
total:  (p=0.95, n=10)
real:   3m11.347s \pm 0m0.009s
user:   1m47.64s  \pm 0m0.13s
sys:    0m0.912s  \pm 0m0.029s

sys+user:       1m48.55s \pm 0m0.13s

for -O2:
total:  (p=0.95, n=10)
real:   3m11.349s \pm 0m0.010s
user:   1m48.00s  \pm 0m0.32s
sys:    0m0.926s  \pm 0m0.025s

sys+user:       1m48.93s \pm 0m0.32s

MAIN RESULTS:
differences in performance time(O2) - time(O4):
\Delta(real): 0m0.002s \pm 0m0.013s
\Delta(user): (0m0.36s \pm 0m0.34s) > 0
\Delta(sys): 0m0.014s \pm 0m0.038s

\Delta(sys+user): (0m0.38s \pm 0m0.36s) > 0

!!! Be aware that you can't simply sum errors while suming values: error 
sum is nonlinear function and in this case is sqrt(sqr(err1)+sqr(err2)) 
according to rules of statistics.

Real time is out of interest: it depends on movie length.
I've compared system perfomance with the help of total time: sys+user. 
As you can see, the difference between -O2 and -O4 is clearly larger 
zero, with taking in account a measurement error.

CONCLUSION:
According to presented experimental data -O4 is faster than -O2 with 
probability more then 95%.
So, -O4 option must be kept by default.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20060916/e953bbe1/attachment.pgp>


More information about the MPlayer-dev-eng mailing list