[FFmpeg-cvslog] r22715 - trunk/libavcodec/bitstream.c

Michael Niedermayer michaelni
Wed May 5 12:56:31 CEST 2010


On Wed, May 05, 2010 at 01:06:09AM +0000, Loren Merritt wrote:
> On Wed, 5 May 2010, Uoti Urpala wrote:
>> On Tue, 2010-05-04 at 23:59 +0100, M?ns Rullg?rd wrote:
>>> Loren Merritt <lorenm at u.washington.edu> writes:
>>>>>> a) malloc.
>>>>>
>>>>> Would this have any measurable impact on performance?  Is this
>>>>> function ever called more than once per frame?
>>>>
>>>> No measurable difference in overall speed for ffvhuff, which has 3
>>>> tables per frame.
>>>> START_TIMER says that the malloc is 400 cycles on linux/x86_64, which
>>>> should make it 0.01% of overall time, or less for large frames.
>>> That settles it for me.
>> You can't completely rule out the performance impact of a repeated
>> malloc with any simple test. It can depend on usage patterns. There's
>> also the effect on memory fragmentation. Even if the code frees the
>> memory without any other allocation in between that may not hold
>> globally due to other threads. In some cases cache effects may matter
>> (malloc is almost certainly worse for cache than stack).
>
> If you want to eliminate some repeated mallocs, then hows about this.
> (Can be applied with or without my previous patch.)
> Still no statistically significant speed change on linux/x86_64.
>
> --Loren Merritt

>  bitstream.c |    7 +++++--
>  get_bits.h  |    2 ++
>  huffyuv.c   |   14 +++++---------
>  3 files changed, 12 insertions(+), 11 deletions(-)
> cf4e0c5f7d61d03ec6936dd778da41f453a5f75b  vlc_reuse_mem.diff

if its faster on some platform or if you prefer it over the existing code
then iam ok with it

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-cvslog/attachments/20100505/5729c0a7/attachment.pgp>



More information about the ffmpeg-cvslog mailing list