lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VcZgkuOA3pSrg7cN36EAB4Y0jV2xFNfj-sGp_C17J2yAQ@mail.gmail.com>
Date:   Sat, 28 Jan 2023 21:54:44 +0200
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     David Laight <David.Laight@...lab.com>
Cc:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Kees Cook <keescook@...omium.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Andy Shevchenko <andy@...nel.org>,
        Rasmus Villemoes <linux@...musvillemoes.dk>,
        Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH v1 1/1] lib/string: Use strchr() in strpbrk()

On Sat, Jan 28, 2023 at 4:51 PM David Laight <David.Laight@...lab.com> wrote:
>
> From: Andy Shevchenko
> > Sent: 27 January 2023 15:52
> >
> > Use strchr() instead of open coding it as it's done elsewhere in
> > the same file. Either we will have similar to what it was or possibly
> > better performance in case architecture implements its own strchr().
>
> Except that you get a whole load of calls to strchr() for (typically)
> very few characters.
> So the cost of the calls dominates, anything that tries to speed up
> strchr() for long strings will also slow things down.

Hmm... I haven't seen the calls, I assume gcc simply inlined a copy of that.

...

> Although I very much doubt strpbrk() is used anywhere where
> performance matters.

strsep()/strspn() are the users.

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists