diff options
| author | Rong Zhang <i@rong.moe> | 2026-07-22 01:50:48 +0800 |
|---|---|---|
| committer | Nicolas Schier <nsc@kernel.org> | 2026-08-05 14:51:59 +0200 |
| commit | dc4ab230d66146cd1f70e257dc773664cfb37a45 (patch) | |
| tree | 2e8e88e14aab2417b17ddc2f74d6c727bbecab32 /tools/perf/scripts/python | |
| parent | 9a5b76027ed91680e10f90111d9cba300f96d1ab (diff) | |
scripts/config: Use POSIX standard ERE (-E) in sed
The use of Extended Regular Expressions was removed by commit
83e8b90e1d2c ("scripts/config: use sed's POSIX interface").
Before that, the script used `-r' to enable ERE, which is indeed
non-portable. However, POSIX.1-2024 [1][2] has accepted `-E' as a
standard option to use ERE for matching, and major sed implementations
(GNU, FreeBSD, OpenBSD, NetBSD, macOS) have supported `-E' for over two
decades, so it makes no sense to use Basic Regular Expressions any more.
Switch to ERE to get rid of chained calls to sed. A rough benchmark with
~1000 editions showed a 40.0% speedup (8.78s => 5.27s, GNU sed). The
FreeBSD sed showed a similar speedup.
Link: https://pubs.opengroup.org/onlinepubs/9799919799/utilities/sed.html [1]
Link: https://austingroupbugs.net/view.php?id=528 [2]
Reviewed-by: Nicolas Schier <nsc@kernel.org>
Signed-off-by: Rong Zhang <i@rong.moe>
Link: https://patch.msgid.link/20260722-config-sed-v2-1-9f2c4b164666@rong.moe
Signed-off-by: Nicolas Schier <nsc@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
