From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 77CCFA04AF;
	Mon,  4 May 2020 11:03:11 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 4A2C01D448;
	Mon,  4 May 2020 11:03:11 +0200 (CEST)
Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com
 [66.111.4.26]) by dpdk.org (Postfix) with ESMTP id EFA141D179
 for <dev@dpdk.org>; Mon,  4 May 2020 11:03:09 +0200 (CEST)
Received: from compute7.internal (compute7.nyi.internal [10.202.2.47])
 by mailout.nyi.internal (Postfix) with ESMTP id 660D95C00D7;
 Mon,  4 May 2020 05:03:09 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162])
 by compute7.internal (MEProxy); Mon, 04 May 2020 05:03:09 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h=
 from:to:cc:subject:date:message-id:in-reply-to:references
 :mime-version:content-transfer-encoding:content-type; s=fm1; bh=
 H+GbMgavUw/CdpeliK3cDTOXrpeDOBMvlUCSjAXtx0c=; b=fZ0wL2D7cZO4JTSP
 cosFZNCWw9UDs9LoB1PMziMkpCgZo262nTE2nuuvHnRw2QCrlETb2UOKu5D7diAW
 BUW2YrSy1YW32KwuDNOf5il0+N0KDjsfK4Gny165jTtunPD3qqICHZCrRxyDzn57
 O6r8O3kCuu6iu2OIB8AkXIq/5R7gtnzd3XNnkqvWe9S9DYreLSqNn4nkT0hwcrPM
 5jORuEMEyn+FeagKQIK0toO1jMXLDlKXofXIoprCYKAZFvbEmVL6oXF38SSzbrq7
 Q18JnDSssynmGzhliOnnrxIxjwJpiG86E6ub0m3eX1lfKxQQph5lCotcYic167Ua
 itMIRw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-transfer-encoding:content-type
 :date:from:in-reply-to:message-id:mime-version:references
 :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender
 :x-sasl-enc; s=fm2; bh=H+GbMgavUw/CdpeliK3cDTOXrpeDOBMvlUCSjAXtx
 0c=; b=0gyH/PjpEHMyhN5LhNa/Q6FFhPJbcLbvu/ZTuBC7OlXS8nkfM9nIs+PiT
 yTueIIeHxpTxKdhOtGKRGa+zEvfrsW7gdhveeGvHjf9NAu/aUdIWvj8NUPaX4ClN
 x/SB++LbI/9ntBP2w58euV0JjTOLOUHqB+cfR5zr/QxLrvbU52GkvUbH9zmpeEs8
 N9rdDEJr25UR8PfQApKkMBmtz4eyTB0Z9o+usyYSImLoyQ+XwTEBDsande/Sgb+f
 k6zSfgJk2lntvBlTyH3BbedGK0i0hZ7h65lTCdxkT/+6v8YgGkC0r6F69Y0uTDQx
 VAKuTzQ6ZZ70ZBTGLGvtzzIWsmMYQ==
X-ME-Sender: <xms:TNqvXkEgvYvzuUCqVl1IB3Zbv3AURyxyBiebFhEOswL3_BRh6VW1xA>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrjeeggddutdcutefuodetggdotefrodftvf
 curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
 uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc
 fjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhmrghs
 ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf
 frrghtthgvrhhnpedugefgvdefudfftdefgeelgffhueekgfffhfeujedtteeutdejueei
 iedvffegheenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuih
 iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhho
 nhdrnhgvth
X-ME-Proxy: <xmx:TNqvXurSPiLfNl8qUVhf5YA2FDAsf5F_uDewT8gYLKV2AgCfNRr7Qg>
 <xmx:TNqvXiwOJf3DVvDDs13bg4aCffZJFWbYqV2MFkgKL-Ru5GNqloxPJQ>
 <xmx:TNqvXow4zvYGVAxB7BZvKJS7M43DpVdsdjqsPnpYitYBBQNEJPcC0Q>
 <xmx:TdqvXryU8gGylk9xBfBynK2b33UpV7lg7EqckeFkOWB16sPTuxus5w>
Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184])
 by mail.messagingengine.com (Postfix) with ESMTPA id 078B0328005A;
 Mon,  4 May 2020 05:03:07 -0400 (EDT)
From: Thomas Monjalon <thomas@monjalon.net>
To: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
Cc: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>,
 "dev@dpdk.org" <dev@dpdk.org>, "aconole@redhat.com" <aconole@redhat.com>,
 nd <nd@arm.com>
Date: Mon, 04 May 2020 11:03:06 +0200
Message-ID: <2150775.ElGaqSPkdT@thomas>
In-Reply-To: <BYAPR11MB33012D89AC7524B941AB15E19AAA0@BYAPR11MB3301.namprd11.prod.outlook.com>
References: <20200429175714.31141-1-konstantin.ananyev@intel.com>
 <DBBPR08MB4646949FAFC2EAC67AF98EF398AA0@DBBPR08MB4646.eurprd08.prod.outlook.com>
 <BYAPR11MB33012D89AC7524B941AB15E19AAA0@BYAPR11MB3301.namprd11.prod.outlook.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
Subject: Re: [dpdk-dev] [PATCH] test/ring: code rework to reduce compilation
	time
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

30/04/2020 16:43, Ananyev, Konstantin:
> 
> Hi Honnappa,
>  
> > Hi Konstantin,
> > 	I like the way the tests are organized and it looks good.
> > 
> > I am just wondering about the way it is being tested here. The intent to write the test cases the way they are currently is to mimic how the
> > APIs would be used mostly. IMO, the APIs would be used with a constant value for element size so that the compiler will throw away the
> > unwanted code (in the functions where the actual copy is being done).
> > 
> > With your method here, it looks to me like all the branches in the copy functions are kept and the branch decisions are done at run time.
> > Is  my understanding correct?
> 
> You mean branching on esize[] values?
> Actually from what I've seen that happens for both cases:
> before and after the patch (gcc 7.3 -O3).
> 
> Main intention in my changes was to avoid using test_ring_enqueue/test_ring_dequeue,
> as it seems too many branches here and it takes compiler a lot of effort to resolve all
> of them at compile time.
> So I replaced it with  array of function pointers (test_enqdeq_impl[]) and iterating over it.
> That way compiler knows straightway which function to use.

In case we choose this solution, please make a v2 including such explanations.