[Mplayer-cvslog] CVS: main/DOCS/tech TODO,1.9,1.10

Michael Niedermayer michaelni at gmx.at
Mon Dec 10 22:50:02 CET 2001


Hi

On Monday 10 December 2001 18:56, Nick Kurshev wrote:
[...]
> > try it yourself (attached benchmark compiled with -O4)
> > the output for my p3 is
> > 51052k cycles needed for 10000000 calls through if/else
> > 140573k cycles needed for 10000000 calls through function pointers
>
> And for witch memcpy?
> fast_memcpy_MMX2 or fast_memcpy_MMX?
none its just a comparision between if/else vs function pointers

> Anyway - it's only in theoretical test but in practic processor won't
> to save conditional branch-table for this branch and probably will
> predict false branch.
it will allways use the same memcpy routine so it should be near 100% 
predictable unless u xchange the cpu while its running ;)

> I know only that manuals always suggested to replace conditional jumps
> with direct code ;)
yes but that isnt possible here
they allso suggest to avoid function pointers

>
> If you will accept my idea - I have solutution for self-modification code
> without changning logic of mplayer of each your TEMPLATE set.
selfmodifying code is possible here yes but u save perhaps 2 cpu cycles while 
a single memory access needs 50 or so, i doubt that it is worth it ... and it 
would only affect the runtime cpu detection enabled binaries, but if u want 
to implement it than do it ... iam allways happy if someone can make the code 
faster :)
btw some comilers might inline the if&else and memcpy function into the 
calling function ... using selfmodifieing code will cause a speedloss here 
because it cant be inlined anymore

[...]

Michael



More information about the MPlayer-cvslog mailing list