[FFmpeg-devel] [RFC] AVDictionary2
softworkz .
softworkz at hotmail.com
Sat Apr 12 04:41:35 EEST 2025
> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> On Behalf Of
> Michael Niedermayer
> Sent: Freitag, 11. April 2025 21:06
> To: FFmpeg development discussions and patches <ffmpeg-devel at ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [RFC] AVDictionary2
>
> Hi
>
> On Tue, Apr 08, 2025 at 09:30:16PM +0000, softworkz . wrote:
> [...]
>
> > To tell you the truth - at that point I was thinking: "Ah, clever!
> That's why the AVDictionary is done like that" 😊
>
> The dictionary implementation is not clever
> look at copy for example it iterates over av_dict_set() which itself
> calls
> av_dict_get() which it itself iterates over the dictionary
> so av_dict_copy() is O(n^2) for example
I meant "clever" in the sense of "intentionally kept simple" and using linear lookup in order to be fast in cases like FFprobe where there's just a very small number of items.
> also a single fate run, calls av_dict_iterate() 4921207 times
> and fate should mostly be short small files and minimal self contained
> testcases
That's 1.2k per test in average..
Now - look at this masterpiece of a sentence:
Isn't it an inevitable FATE for an iterator implementation
to see such high invocation counts?
😊😊😊
sw
More information about the ffmpeg-devel
mailing list