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: <0e603b02-b272-4bcc-8b86-1a3dca9477d7@icloud.com>
Date: Mon, 7 Apr 2025 22:33:34 +0800
From: Zijun Hu <zijun_hu@...oud.com>
To: Andy Shevchenko <andy@...nel.org>
Cc: Kees Cook <kees@...nel.org>, Andrew Morton <akpm@...ux-foundation.org>,
 linux-hardening@...r.kernel.org, linux-kernel@...r.kernel.org,
 Zijun Hu <quic_zijuhu@...cinc.com>, "Rob Herring (Arm)" <robh@...nel.org>
Subject: Re: [PATCH 1/2] lib/string: Improve strstarts() performance

On 2025/4/7 21:51, Andy Shevchenko wrote:
> First of all, this function is supposed to be run against constant string literals.

for strstarts(s, "prefix"), strlen("prefix") should *NOT* be compile
time constant. it is a loop and unavoidable to have strlen("prefix")
iterations.

> 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.

for either constant string or non constant string. this patch
eliminating a loop which have strlen()iterations. i feel it is obvious
it can improve performance.



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ