From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ob0-f177.google.com (mail-ob0-f177.google.com [209.85.214.177]) by dpdk.org (Postfix) with ESMTP id 015B2E72 for ; Thu, 23 Apr 2015 15:53:44 +0200 (CEST) Received: by oblw8 with SMTP id w8so13884026obl.0 for ; Thu, 23 Apr 2015 06:53:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=uOrOY5tTvFPGoPmBSUAAWoEm7oDdM0SQ3U94gHd35u0=; b=UeCVmtWhJmtwgekB9BRLPUmtQ/80vAh1Xr3sj+DcpBKteuF7T0LwnfJND5TlcLyzWu 5Rdl1OBlgBn9Fwuu9Kld53fFSy3w+onsIJykzXzXB/tENsJB+Af9SPloQIpOqHxKaHJJ +1AwPrGqANR7WRb75mqPvm2T8PJs+VV865nsAVfy7TGb8/UfcpWhK7ENoE+UJ4LfmuLA 2plbWJKvt6n/bXSx5INHq8hqZg/b7Ixav/Jo6vJFO8oflIUlttWWurIZ1BUhfUdLK+0X aTHGF0y47ixUewurXIeIj68xFhNtRR/aLjRcDWCai3ColC9EbHoFocrQckLavTq6jauj BuWg== MIME-Version: 1.0 X-Received: by 10.182.24.5 with SMTP id q5mr2556257obf.8.1429797224466; Thu, 23 Apr 2015 06:53:44 -0700 (PDT) Received: by 10.202.179.195 with HTTP; Thu, 23 Apr 2015 06:53:44 -0700 (PDT) In-Reply-To: <2601191342CEEE43887BDE71AB97725821420FC7@irsmsx105.ger.corp.intel.com> References: <1429716828-19012-1-git-send-email-rkerur@gmail.com> <1429716828-19012-2-git-send-email-rkerur@gmail.com> <55389E44.8030603@intel.com> <20150423081138.GA8592@bricha3-MOBL3> <2601191342CEEE43887BDE71AB97725821420FC7@irsmsx105.ger.corp.intel.com> Date: Thu, 23 Apr 2015 06:53:44 -0700 Message-ID: From: Ravi Kerur To: "Ananyev, Konstantin" Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH] Implement memcmp using AVX/SSE instructio X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Apr 2015 13:53:45 -0000 On Thu, Apr 23, 2015 at 2:23 AM, Ananyev, Konstantin < konstantin.ananyev@intel.com> wrote: > > > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson > > Sent: Thursday, April 23, 2015 9:12 AM > > To: Wodkowski, PawelX > > Cc: dev@dpdk.org > > Subject: Re: [dpdk-dev] [PATCH] Implement memcmp using AVX/SSE instructio > > > > On Thu, Apr 23, 2015 at 09:24:52AM +0200, Pawel Wodkowski wrote: > > > On 2015-04-22 17:33, Ravi Kerur wrote: > > > >+/** > > > >+ * Compare bytes between two locations. The locations must not > overlap. > > > >+ * > > > >+ * @note This is implemented as a macro, so it's address should not > be taken > > > >+ * and care is needed as parameter expressions may be evaluated > multiple times. > > > >+ * > > > >+ * @param src_1 > > > >+ * Pointer to the first source of the data. > > > >+ * @param src_2 > > > >+ * Pointer to the second source of the data. > > > >+ * @param n > > > >+ * Number of bytes to compare. > > > >+ * @return > > > >+ * true if equal otherwise false. > > > >+ */ > > > >+static inline bool > > > >+rte_memcmp(const void *src_1, const void *src, > > > >+ size_t n) __attribute__((always_inline)); > > > You are exposing this as public API, so I think you should follow > > > description bellow or not call this _memcmp_ > > > > > > int memcmp(const void *s1, const void *s2, size_t n); > > > > > > The memcmp() function returns an integer less than, equal to, or > greater > > > than > > > zero if the first n bytes of s1 is found, respectively, > to be > > > less than, to > > > match, or be greater than the first n bytes of s2. > > > > > > > +1 to this point. > > > > Also, if I read your quoted performance numbers in your earlier mail > correctly, > > we are only looking at a 1-4% performance increase. Is the additional > code to > > maintain worth the benefit? > > Yep, same thought here, is it really worth it? > Konstantin > > > > > /Bruce > > > > > -- > > > Pawel > I think I haven't exploited every thing x86 has to offer to improve performance. I am looking for inputs. Until we have exhausted all avenues I don't want to drop it. One thing I have noticed is that bigger key size gets better performance numbers. I plan to re-run perf tests with 64 and 128 bytes key size and will report back. Any other avenues to try out please let me know I will give it a shot. Thanks, Ravi