[Ffmpeg-devel] Re: fastmemcpy in ffmpeg

Rich Felker dalias
Tue Sep 26 02:16:33 CEST 2006


On Mon, Sep 25, 2006 at 04:03:39PM +0200, Ronald S. Bultje wrote:
> Hi,
> 
> On Mon, 25 Sep 2006, Gunnar von Boehn wrote:
> > Just by
> > adding one prefetch instruction to the normal Linux memcpy you can speed
> > it up a lot 50%.
> [..]
> 
> So why don't you submit such work for inclusion in glibc? That way,
> everybody profits!

No, multimedia apps profit and everyone else loses. fastmemcpy is
several times slower for tiny copies, which are the only thing that
_normal_ apps ever do. The only type of memcpy that belongs in libc is
the ultra-trivial implementation which (on the i386 family) happens to
also be the fastest implementation that works on all cpu generations.
Anything like fastmemcpy requires either cpu-specific libc or runtime
cpudetect, the former of which is probably not acceptable for most
users and the latter of which will be horribly slow for the common
cases...

There's already plenty of cases of idiotic micro-optimization in glibc
which actually causes huge bloat and worse performance in most real
world cases. Don't give them any more bad ideas. As an example, my
trivial stdio implementation outperforms their 'advanced' one by quite
a bit..

Rich





More information about the ffmpeg-devel mailing list