Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Leo Izen <leo.izen@gmail.com>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [PATCH v3] libavutil: Add AVMap
Date: Fri, 18 Apr 2025 10:46:42 -0400
Message-ID: <3359dc33-ab0c-4c78-9621-6be97dff07df@gmail.com> (raw)
In-Reply-To: <20250417201238.GU4991@pb2>

On 4/17/25 16:12, Michael Niedermayer wrote:
>>
>>> + * @param keyvalue_cmp compare function, will be passed the key + value concatenated.
>>
>> Please no. Pass the key and the value separately to the compare
>> function.
> 
> thats neither efficient nor does it fit the existing APIs.
> The value is most of the time not used and when used it is known exactly
> where it is. after a string compare of the key thats equal the value location is known
> or with arbitrary binary data the compare function knows the size of the data.
> Passing redudant pointers just wastes cpu cycles
> also existing APIs from av_tree strcmp() av_strcasecmp() and so on none of
> which take 4 pointers from which they would ignore 2.
> 
The problem is that passing the key and value pairs combined requires 
you to concatenate them. Since AVMapEntry has two separate pointers *key 
and *value, it doesn't make sense to concatenate them before comparison
rather than just pass the pointers as-is.

- Leo Izen (Traneptora)

_______________________________________________
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".

  reply	other threads:[~2025-04-18 14:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-17 16:52 Michael Niedermayer
2025-04-17 17:57 ` Nicolas George
2025-04-17 20:12   ` Michael Niedermayer
2025-04-18 14:46     ` Leo Izen [this message]
2025-04-19  1:23       ` Michael Niedermayer
2025-04-19 13:03     ` Nicolas George
2025-04-19 16:23       ` Michael Niedermayer
2025-04-19 17:23         ` Nicolas George
2025-04-19 17:36           ` Nicolas George
2025-04-19 10:36 ` Leo Izen
2025-04-19 14:39   ` Michael Niedermayer

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=3359dc33-ab0c-4c78-9621-6be97dff07df@gmail.com \
    --to=leo.izen@gmail.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /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