From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <ffmpeg-devel-bounces@ffmpeg.org>
Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100])
	by master.gitmailbox.com (Postfix) with ESMTPS id BB93A4D2D8
	for <ffmpegdev@gitmailbox.com>; Wed, 16 Apr 2025 13:52:15 +0000 (UTC)
Received: from [127.0.1.1] (localhost [127.0.0.1])
	by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CAE6B68813B;
	Wed, 16 Apr 2025 16:52:10 +0300 (EEST)
Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net
 [217.70.183.195])
 by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 38D3B687CE8
 for <ffmpeg-devel@ffmpeg.org>; Wed, 16 Apr 2025 16:52:04 +0300 (EEST)
Received: by mail.gandi.net (Postfix) with ESMTPSA id 9CDEB1FCEA
 for <ffmpeg-devel@ffmpeg.org>; Wed, 16 Apr 2025 13:52:03 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc;
 s=gm1; t=1744811523;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=ChUua7vhBeCMDZVxdPPMenDfsNiSwuaZN7QslCPbzyg=;
 b=e3DG99uRu/NUDoGgD3Bi2C17i2/olrY1Vmnw1uBeLMhk2LQ1DXy1hezDayHbz81P4xEeVF
 LHjv9dSvLKUph9AZd0zWeYGG7AO9mHxvPalZKFQ3dv+E/HuyD/fz9PuOvoNSm2X58awNGi
 DU8Y8M9+nGJHnTxnUu9X5INBK6FO3DHTnQ/eviuJxM65djp+Sc9ll9aw5b5Ou0AsCYPJRZ
 wztb7EWOrEslL82JYt2ubfjaTF0k0ycKplfHBi8zep4Y6BQwitMEuazRllG8jtT+QctGlT
 FG25TouC2KI3KqjYvreh7H+z3GsOkWkCGppTl4vhUgG4T1BTC/i5Vvr9BdHV7w==
Date: Wed, 16 Apr 2025 15:52:03 +0200
From: Michael Niedermayer <michael@niedermayer.cc>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Message-ID: <20250416135203.GL4991@pb2>
References: <20250415205039.537639-1-michael@niedermayer.cc>
 <DM8P223MB0365093E495C0404C6E78A36BAB22@DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM>
MIME-Version: 1.0
In-Reply-To: <DM8P223MB0365093E495C0404C6E78A36BAB22@DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM>
X-GND-State: clean
X-GND-Score: -85
X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvvdeiheefucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfghrlhcuvffnffculdduhedmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefoihgthhgrvghlucfpihgvuggvrhhmrgihvghruceomhhitghhrggvlhesnhhivgguvghrmhgrhigvrhdrtggtqeenucggtffrrghtthgvrhhnpeeigeektdejudffjefhteegjedtgeettefggedthfejgfevhfetgeekjedtvdfhveenucfkphepgedurdeiiedrieejrdduudefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepgedurdeiiedrieejrdduudefpdhhvghloheplhhotggrlhhhohhsthdpmhgrihhlfhhrohhmpehmihgthhgrvghlsehnihgvuggvrhhmrgihvghrrdgttgdpnhgspghrtghpthhtohepuddprhgtphhtthhopehffhhmphgvghdquggvvhgvlhesfhhfmhhpvghgrdhorhhg
X-GND-Sasl: michael@niedermayer.cc
Subject: Re: [FFmpeg-devel] [PATCH v3] [NOT for git] avutil/tests/map:
 benchmark code [BENCHMARK included]
X-BeenThere: ffmpeg-devel@ffmpeg.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: FFmpeg development discussions and patches <ffmpeg-devel.ffmpeg.org>
List-Unsubscribe: <https://ffmpeg.org/mailman/options/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=unsubscribe>
List-Archive: <https://ffmpeg.org/pipermail/ffmpeg-devel>
List-Post: <mailto:ffmpeg-devel@ffmpeg.org>
List-Help: <mailto:ffmpeg-devel-request@ffmpeg.org?subject=help>
List-Subscribe: <https://ffmpeg.org/mailman/listinfo/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=subscribe>
Reply-To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Content-Type: multipart/mixed; boundary="===============4766373242709147481=="
Errors-To: ffmpeg-devel-bounces@ffmpeg.org
Sender: "ffmpeg-devel" <ffmpeg-devel-bounces@ffmpeg.org>
Archived-At: <https://master.gitmailbox.com/ffmpegdev/20250416135203.GL4991@pb2/>
List-Archive: <https://master.gitmailbox.com/ffmpegdev/>
List-Post: <mailto:ffmpegdev@gitmailbox.com>


--===============4766373242709147481==
Content-Type: multipart/signed; micalg=pgp-sha512;
	protocol="application/pgp-signature"; boundary="luC6nNgPwKyp+VTx"
Content-Disposition: inline


--luC6nNgPwKyp+VTx
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Apr 15, 2025 at 11:24:37PM +0000, softworkz . wrote:
>=20
>=20
> > -----Original Message-----
> > From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of
> > Michael Niedermayer
> > Sent: Dienstag, 15. April 2025 22:51
> > To: FFmpeg development discussions and patches <ffmpeg-
> > devel@ffmpeg.org>
> > Subject: [FFmpeg-devel] [PATCH v3] [NOT for git] avutil/tests/map:
> > benchmark code [BENCHMARK included]
> >=20
>=20
> [..]
>=20
> >=20
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > ---
> >  libavutil/tests/map.c | 57
> > +++++++++++++++++++++++++++++++++++++++++++
> >  1 file changed, 57 insertions(+)
> >=20
> > diff --git a/libavutil/tests/map.c b/libavutil/tests/map.c
> > index 38f0a153e68..90950769f98 100644
> > --- a/libavutil/tests/map.c
> > +++ b/libavutil/tests/map.c
> > @@ -26,6 +26,8 @@
> >  #include "libavutil/mem.h"
> >  #include "libavutil/map.h"
> >=20
> > +#include "libavutil/timer.h"
> > +#include "libavutil/dict.h"
> >=20
> >  static void print_set(const AVMap *s)
> >  {
> > @@ -37,6 +39,7 @@ static void print_set(const AVMap *s)
> >=20
> >  int main(void)
> >  {
> > +#if 0
> >      void *our_cmp[] =3D {
> >          strcmp,
> >          av_map_strcmp_keyvalue,
> > @@ -185,6 +188,60 @@ int main(void)
> >          av_map_free(&set);
> >          av_assert0(!set);
> >      }
> > +#else
> > +#define N_ENTRIES 1000
> > +#define P 4
> > +    fprintf(stderr, "%d entries variable bytes at location %d-%d\n",
> > N_ENTRIES, P, P+1);
> > +    for (int runs =3D 0; runs < 1000; runs++) {
> > +        AVMap *map =3D av_map_new(av_strcasecmp, NULL, NULL);
> > +        for(int pass =3D 0; pass < 2; pass++) {
> > +            START_TIMER
> > +            unsigned r =3D 5;
> > +            for(int i=3D0; i<N_ENTRIES; i++) {
> > +                r =3D r*123 + 7;
> > +                char str[7] =3D "TEST";
> > +                str[P  ] =3D r;
> > +                str[P+1] =3D r>>8;
> > +                if(pass =3D=3D 0) {
> > +                    av_map_add(map, str, 7, str, 7, 0);
> > +                } else {
> > +                    av_map_get(map, str, av_strcasecmp);
> > +                }
> > +            }
> > +            if (pass) {
> > +                STOP_TIMER("av_map_get")
> > +            } else {
> > +                STOP_TIMER("av_map_add")
> > +            }
> > +        }
> > +        av_map_free(&map);
> > +    }
> > +
> > +    for (int runs =3D 0; runs < 1000; runs++) {
> > +        AVDictionary *dict =3D NULL;
> > +        for(int pass =3D 0; pass < 2; pass++) {
> > +            START_TIMER
> > +            unsigned r =3D 5;
> > +            for(int i=3D0; i<N_ENTRIES; i++) {
> > +                r =3D r*123 + 7;
> > +                char str[7] =3D "TEST";
> > +                str[P  ] =3D r;
> > +                str[P+1] =3D r>>8;
> > +                if(pass =3D=3D 0) {
> > +                    av_dict_set(&dict, str, str, 0);
> > +                } else {
> > +                    av_dict_get(dict, str, NULL, 0);
> > +                }
> > +            }
> > +            if (pass) {
> > +                STOP_TIMER("av_dict_get")
> > +            } else {
> > +                STOP_TIMER("av_dict_set")
> > +            }
> > +        }
> > +        av_dict_free(&dict);
> > +    }
> > +#endif
> >=20
> >      return 0;
> >  }
> > --
>=20
> Hi Michael,
>=20
> is av_map_get() supposed tg work? I wasn't able to retrieve any values
> (always null return).

if you flip the #if 0 above this is a test that tests
av_map_get() and other functions.
Its new code and certainly bugs remain.
If you found cases that dont work, send a patch that adds these
cases to this test, and ill look at it eventually
or even better send a patch that fixes the issue you found

thx

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

If you drop bombs on a foreign country and kill a hundred thousand
innocent people, expect your government to call the consequence
"unprovoked inhuman terrorist attacks" and use it to justify dropping
more bombs and killing more people. The technology changed, the idea is old.

--luC6nNgPwKyp+VTx
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZ/+2AgAKCRBhHseHBAsP
q0EzAJ9NLwNBnpqG1lPdw31lBS5rbrrANACgkmgY/yiWJo+Hvl49m5rHqhgSAwA=
=vUJ7
-----END PGP SIGNATURE-----

--luC6nNgPwKyp+VTx--

--===============4766373242709147481==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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

--===============4766373242709147481==--