From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 3251740D34 for ; Tue, 24 Oct 2023 09:54:50 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4C90868CA11; Tue, 24 Oct 2023 12:54:47 +0300 (EEST) Received: from mail-qt1-f176.google.com (mail-qt1-f176.google.com [209.85.160.176]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D9ED068C98C for ; Tue, 24 Oct 2023 12:54:40 +0300 (EEST) Received: by mail-qt1-f176.google.com with SMTP id d75a77b69052e-41ce4ebecdfso1060331cf.0 for ; Tue, 24 Oct 2023 02:54:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698141279; x=1698746079; darn=ffmpeg.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=l2rVLwNIhgH6F40MizKQZoUDdqAeWses3vdltV4mXUk=; b=lt4mTeB4Tcbe2w/NAed1dR4R7G5fB0Bat77uGAxF58ffJDxRXfBSOCXVOv9pjj95c+ bskuYCNLwhblXFumy6k7xMc2VqRnbEU2wdThbuoybH2Nfvo6AZKyX2P1xXQ9L5EGsLlI Djp5fyXKynJ7HXZxWtRcAT3YHCTWlNYOAZKIbO+Bm7bHJuzyoLOxuVN6vMLBhrblEKaV 8PCpVYt5U+jfeyZKlImpXaUW9+WNEGc0mphLidyuy1X/7S7ImOWgY7Jq75Zw3lQ43CsR 8AmG4Z9PO0+kyPnOauOZ+aM7epsNTBA1bqNuvqd4JAlBYYzb+5nueVKA5Ycn+15wRiQq qVvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698141279; x=1698746079; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=l2rVLwNIhgH6F40MizKQZoUDdqAeWses3vdltV4mXUk=; b=w7cBSAsWyK+9tVZ1jVLogyv6Ifk7xqvZoui7GiPBWQxpvq1WJzSsl7NBtdUGhmNYz4 D+2DRBmPmYqYYfJZM8ySV6NbyPeIksbq4qRKHdV+jAtgUMc6BDmcyhT3to409tfpSYN2 6618xk4k0rK1xc6kUevxDhkdd8ywt5vx6sNqUYfBLMzLIu4ejEGmtyjiQNRS6vOc1Thf hGl71mQO3yezH4ZI4Ey/32j8sHEwj0HnNR/ZaLByWweqhA/GovMIw6OU+vzzxWXZPt5G ZsTmCBXtiT8FqYbB+tUzjnUb65h3hyn8V7VFTp0oWx0unYeFGvXtGgfJzy3c9w4D3tm8 DvKw== X-Gm-Message-State: AOJu0YwUKgJNA4FcajhsV10LEXrNO6g4RrI9zAw6AAW0QOOMMnum1AVy LfV88qUwAD0ATsbrfavaKGrxBCI4XPUst4PC X-Google-Smtp-Source: AGHT+IEiOMG0mDKArm6Bhb1Jz0YCZCDmDe31wo/UnxVsjPQ/g5+A57DZeZHqjPXW7/cIiiVmixyKOg== X-Received: by 2002:a05:622a:1a8b:b0:412:1aa7:786 with SMTP id s11-20020a05622a1a8b00b004121aa70786mr11686153qtc.1.1698141278976; Tue, 24 Oct 2023 02:54:38 -0700 (PDT) Received: from [192.168.1.35] (c-68-56-149-176.hsd1.mi.comcast.net. [68.56.149.176]) by smtp.gmail.com with ESMTPSA id h21-20020ac87455000000b00419b094537esm3367618qtr.59.2023.10.24.02.54.38 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 24 Oct 2023 02:54:38 -0700 (PDT) Message-ID: Date: Tue, 24 Oct 2023 05:54:37 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: ffmpeg-devel@ffmpeg.org References: <20231022215113.3469-1-michael@niedermayer.cc> <20231022215113.3469-5-michael@niedermayer.cc> <7096e5b9-6a8e-4875-a3b6-32b2fe2dbb11@gmail.com> <20231023160416.GY3543730@pb2> Content-Language: en-US-large From: Leo Izen In-Reply-To: <20231023160416.GY3543730@pb2> Subject: Re: [FFmpeg-devel] [PATCH 5/9] avcodec/vlc: Pass VLC_MULTI_ELEM directly not by pointer X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 10/23/23 12:04, Michael Niedermayer wrote: > On Mon, Oct 23, 2023 at 02:10:35AM -0400, Leo Izen wrote: >> On 10/22/23 17:51, Michael Niedermayer wrote: >>> This makes the code more testable as uninitialized fields are 0 >>> and not random values from the last call >>> >>> Signed-off-by: Michael Niedermayer >>> --- >>> libavcodec/vlc.c | 14 +++++++------- >>> 1 file changed, 7 insertions(+), 7 deletions(-) >>> >>> diff --git a/libavcodec/vlc.c b/libavcodec/vlc.c >>> index 9b7a42f79a3..4adec2da705 100644 >>> --- a/libavcodec/vlc.c >>> +++ b/libavcodec/vlc.c >>> @@ -356,7 +356,7 @@ static void add_level(VLC_MULTI_ELEM *table, const int is16bit, >>> uint32_t curcode, int curlen, >>> int curlimit, int curlevel, >>> const int minlen, const int max, >>> - unsigned* levelcnt, VLC_MULTI_ELEM *info) >>> + unsigned* levelcnt, VLC_MULTI_ELEM info) >> >> >> Is passing a struct by value advisable? Did you benchmark this? How does it >> compare to memset(info, 0, sizeof(*info))? > > The struct is 8 bytes, a pointer on 64bit arch is also 8byte > > I did not benchmark, I think this code doesnt run that many iterations > (when its not buggy), I mean each iteration adds a entry to the table > and the table will normally be designed to fit in cache and its only > for initializing. > > do you still want me to bechmark this ? > > thx > If the struct is only 8 bytes it's probably not necessary. - 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".