public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
To: Alexander Monakov <amonakov@ispras.ru>, "H.J. Lu" <hjl.tools@gmail.com>
Cc: GNU C Library <libc-alpha@sourceware.org>
Subject: Re: [PATCH v2] x86-64: Optimize strcmp/wcscmp with AVX2
Date: Fri, 01 Jun 2018 20:23:00 -0000	[thread overview]
Message-ID: <03bdf89c47880fd0734fc5b82213fc3c98eab372.camel@linux.intel.com> (raw)
In-Reply-To: <alpine.LNX.2.20.13.1806011824140.1892@monopod.intra.ispras.ru>

On Fri, 2018-06-01 at 18:28 +0300, Alexander Monakov wrote:
> On Fri, 1 Jun 2018, H.J. Lu wrote:
> > Please mention strncmp and wcsncmp in commit subject.  OK with this
> > change.
> 
> Many Intel CPUs reduce operating frequency upon encountering AVX
> code,
> and some have a "spin-up" period when frequency is not yet changed
> and
> AVX code runs at reduced throughput. Thus, why is this change not
> detrimental in practice, doesn't it slow down all code (including
> other
> programs running on the same core) as soon as a program makes a call
> to strcmp?

this is partially true for AVX2 FMA and AVX512. What I am proposing
contains none of the latter instructions, just AVX2 without FMA
instructions.

In the other hand, some microbenchmarks were done to see the benefit of
this effort, which is resumed on the commit description but the
complete picture is here 

https://github.com/lsandoval/strcmp-avx2-benchmark/blob/master/string-c
omparison-avx2.png

The above numbers are based on a SkyLake platform.

> 
> Alexander

  reply	other threads:[~2018-06-01 20:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-29 18:53 leonardo.sandoval.gonzalez
2018-06-01 14:46 ` H.J. Lu
2018-06-01 15:30   ` Alexander Monakov
2018-06-01 20:23     ` Leonardo Sandoval [this message]
2018-06-02  7:46       ` Alexander Monakov
2018-06-02 11:37         ` Florian Weimer
2018-06-04 14:14         ` Leonardo Sandoval
2018-06-05 10:14           ` Alexander Monakov
2018-06-05 14:02             ` Leonardo Sandoval

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=03bdf89c47880fd0734fc5b82213fc3c98eab372.camel@linux.intel.com \
    --to=leonardo.sandoval.gonzalez@linux.intel.com \
    --cc=amonakov@ispras.ru \
    --cc=hjl.tools@gmail.com \
    --cc=libc-alpha@sourceware.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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).