[FFmpeg-devel] [PATCH] aacenc: optimize cost cache.
Reimar Döffinger
Reimar.Doeffinger at gmx.de
Wed Mar 2 08:15:21 CET 2016
On 02.03.2016, at 04:34, Ganesh Ajjanagadde <gajjanag at gmail.com> wrote:
> On Tue, Mar 1, 2016 at 6:34 PM, Reimar Döffinger
> <Reimar.Doeffinger at gmx.de> wrote:
>> Avoids trashing the CPU cache each time the
>> cost cache is cleared.
>
> Just curious as to roughly the magnitude of perf improvement? No
> comments on the patch itself.
Didn't measure properly, approx. 6% with the one test file.
However I think now it might be better to just use a generational cache instead (i.e. store and compare a generation counter in the cache instead of clearing, only clear when that counter wraps around).
That would keep unused elements completely out of the cache.
Changing the cache layout so that a higher ratio of elements are in the CPU cache and close together (e.g. by using some kind of "hash") might be worth a try, too.
Because the current structure is unfortunately larger than even common L2 cache sizes.
More information about the ffmpeg-devel
mailing list