From: sashiko-bot@kernel.org
To: Qerogram <qerogram@naver.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH perf-tools-next] perf list: Avoid repeated strlen when escaping JSON strings
Date: Thu, 10 Sep 2026 12:55:58 +0000 [thread overview]
Message-ID: <20260910125558.E54B71F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260910123839.72285-1-qerogram@naver.com>
> The %S conversion in fix_escape_fprintf() calls strlen(s) in the loop
> condition while escaping each character. GCC 14.2.0 retains this call
> inside the loop in a normal DEBUG=0 (-O3) perf build, repeatedly scanning
> the whole string.
>
> Test the current character for NUL instead. This processes the same bytes
> without rescanning the string. Escaping and buffer growth are unchanged.
>
> Full-command wall-clock measurements on an Apple M5 Pro host running an
> aarch64 Linux container with GCC 14.2.0 and glibc 2.41 gave these medians:
>
> perf list --json metrics Before (ms) After (ms)
> Default catalog 0.5969 0.5855
> PERF_CPUID=0x00000000410fd830 0.7818 0.7033
>
> [ ... ]
> Codex assisted with identifying the redundant scan, preparing the change,
> and running the comparisons.
>
> Assisted-by: LLM
> Signed-off-by: Qerogram <qerogram@naver.com>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260910123839.72285-1-qerogram@naver.com?part=1
next prev parent reply other threads:[~2026-09-10 12:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-10 12:38 [PATCH perf-tools-next] perf list: Avoid repeated strlen when escaping JSON strings Qerogram
2026-09-10 12:55 ` sashiko-bot [this message]
2026-09-13 21:45 ` Arnaldo Carvalho de Melo
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=20260910125558.E54B71F00893@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=qerogram@naver.com \
--cc=sashiko-reviews@lists.linux.dev \
/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