From: ffmpegagent <ffmpegagent@gmail.com> To: ffmpeg-devel@ffmpeg.org Cc: softworkz <softworkz@hotmail.com> Subject: [FFmpeg-devel] [PATCH 0/3] avutil/dict2: Add AVDictionary2 with hash-based lookup Date: Sat, 12 Apr 2025 15:11:55 +0000 Message-ID: <pull.64.ffstaging.FFmpeg.1744470718.ffmpegagent@gmail.com> (raw) This is probably a PREMIERE. This whole patchset has been antirely authored by AI, wich means that I haven't written a single line of code. Still it had required a lot of strong guidance, so it wouldn't have been able to do it alone. Even though it was an experiment, it is still meant to be a serious submission - otherwisse it would be a pointless endeavour. The instructions were actuall given by Michael through his recent RFC message and I hat assembled them from two of the e-mails to this: https://gist.github.com/softworkz/c7a60c49e9e2b087bdf276ddf5dcf843 The initial direction was closely along the proposed text and atttempting to use avtree for the search, but it struggled hard on that (one issue was about translating/adapting the callback-based tree-enumeration to an iterator-based API without doing allocations (which I forbid). It ended up genereating a hash-based dictionary and after rejecting it for 2h, I let it go with it - also due to the great performacne profile that it provides. The original approach had implemented the single-memory strategy as proposed by Michael but it hasn't been done for the final implementation (in this PR). From the figures it just doesn't appear to be worth the effort. When you have achieved an improvement by like factor 100 - which is HUGE - then there's not much point in spending effort on something which woiuld bring an improvement by a single percent at best. Anyway, it can still be improved. This PR provides a solid hash-based dictionary without over-complication and decent performance - at least when comparing to the old dictionary, The only cases where AVDictionary is preferable over AVDictionary2 is when there's a small number iof itemss in the dictionary or parameters like NO_STRDUP are used. softworkz (3): avutil/dict2: Add AVDictionary2 with hash-based lookup doc/dict2: Add doc and api change for AVDictionary2 tests/dict2: Add tests and benchmark for AVDictionary2 doc/APIchanges | 3 + doc/dict2.md | 44 +++++ libavutil/Makefile | 3 + libavutil/dict2.c | 335 +++++++++++++++++++++++++++++++++++++ libavutil/dict2.h | 167 ++++++++++++++++++ libavutil/tests/dict2.c | 185 ++++++++++++++++++++ libavutil/version.h | 2 +- tests/api/Makefile | 1 + tests/api/api-dict2-test.c | 122 ++++++++++++++ tests/fate/api.mak | 15 ++ tools/Makefile | 2 +- tools/dict2_benchmark.c | 237 ++++++++++++++++++++++++++ 12 files changed, 1114 insertions(+), 2 deletions(-) create mode 100644 doc/dict2.md create mode 100644 libavutil/dict2.c create mode 100644 libavutil/dict2.h create mode 100644 libavutil/tests/dict2.c create mode 100644 tests/api/api-dict2-test.c create mode 100644 tools/dict2_benchmark.c base-commit: b02985b12c30fe44ca5abf5f90c39f2542b10ad7 Published-As: https://github.com/ffstaging/FFmpeg/releases/tag/pr-ffstaging-64%2Fsoftworkz%2Favdict2_test-v1 Fetch-It-Via: git fetch https://github.com/ffstaging/FFmpeg pr-ffstaging-64/softworkz/avdict2_test-v1 Pull-Request: https://github.com/ffstaging/FFmpeg/pull/64 -- ffmpeg-codebot _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
next reply other threads:[~2025-04-12 15:12 UTC|newest] Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top 2025-04-12 15:11 ffmpegagent [this message] 2025-04-12 15:11 ` [FFmpeg-devel] [PATCH 1/3] " softworkz 2025-04-16 21:24 ` Michael Niedermayer 2025-04-16 22:38 ` softworkz . 2025-04-12 15:11 ` [FFmpeg-devel] [PATCH 2/3] doc/dict2: Add doc and api change for AVDictionary2 softworkz 2025-04-16 21:48 ` Michael Niedermayer 2025-04-16 22:43 ` softworkz . 2025-04-16 23:15 ` softworkz . 2025-04-16 23:40 ` Michael Niedermayer 2025-04-17 22:38 ` softworkz . 2025-04-19 2:28 ` Michael Niedermayer 2025-04-19 13:43 ` softworkz . 2025-04-20 20:37 ` Michael Niedermayer 2025-04-12 15:11 ` [FFmpeg-devel] [PATCH 3/3] tests/dict2: Add tests and benchmark " softworkz 2025-04-14 11:02 ` [FFmpeg-devel] [PATCH 0/3] avutil/dict2: Add AVDictionary2 with hash-based lookup Nicolas George 2025-04-14 11:50 ` softworkz . 2025-04-14 13:21 ` softworkz .
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=pull.64.ffstaging.FFmpeg.1744470718.ffmpegagent@gmail.com \ --to=ffmpegagent@gmail.com \ --cc=ffmpeg-devel@ffmpeg.org \ --cc=softworkz@hotmail.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git