All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy@kernel.org>
To: Zijun Hu <zijun_hu@icloud.com>
Cc: Kees Cook <kees@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org,
	Zijun Hu <quic_zijuhu@quicinc.com>,
	"Rob Herring (Arm)" <robh@kernel.org>
Subject: Re: [PATCH 1/2] lib/string: Improve strstarts() performance
Date: Mon, 7 Apr 2025 16:51:48 +0300	[thread overview]
Message-ID: <Z_PYdARMy0_iW4wD@smile.fi.intel.com> (raw)
In-Reply-To: <20250407-imp_str_perf-v1-1-ed95d52964a4@quicinc.com>

On Mon, Apr 07, 2025 at 09:15:04PM +0800, Zijun Hu wrote:
> From: Zijun Hu <quic_zijuhu@quicinc.com>
> 
> strstarts() is frequently invoked to test if a string has another string
> as prefix, but its performance is degraded by the strlen() loop contained.
> 
> Improve its performance by eliminating the strlen() loop.

NAK.

First of all, this function is supposed to be run against constant string literals.
Second, this commit message has zero proofs to tell if there is actual performance
downgrage even in the case when prefix is not a constant string literal.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2025-04-07 13:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-07 13:15 [PATCH 0/2] lib/string: Improve performance for both strstarts() and str_has_prefix() Zijun Hu
2025-04-07 13:15 ` [PATCH 1/2] lib/string: Improve strstarts() performance Zijun Hu
2025-04-07 13:51   ` Andy Shevchenko [this message]
2025-04-07 14:33     ` Zijun Hu
2025-04-07 14:39       ` Andy Shevchenko
2025-04-07 14:53         ` Zijun Hu
2025-04-07 16:17   ` Kees Cook
2025-04-08 11:34     ` Zijun Hu
2025-04-08 13:13   ` kernel test robot
2025-04-07 13:15 ` [PATCH 2/2] lib/string: Improve str_has_prefix() performance Zijun Hu
2025-04-07 13:52   ` Andy Shevchenko
2025-04-07 13:49 ` [PATCH 0/2] lib/string: Improve performance for both strstarts() and str_has_prefix() Andy Shevchenko

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=Z_PYdARMy0_iW4wD@smile.fi.intel.com \
    --to=andy@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=kees@kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=quic_zijuhu@quicinc.com \
    --cc=robh@kernel.org \
    --cc=zijun_hu@icloud.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.