On 02/12/2026 21:09, Paul Eggert wrote:
On 2026-12-02 12:24, Pádraig Brady wrote:
This avoids issues on misconfigured systems like with GLIBC:
https://sourceware.org/PR35092
The changes to lib/mcel.h and to modules/mcel would surely cause a
significant slowdown in applications using mcel, as every call to
mcel_scan would have to call __ctype_get_mb_cur_max on glibc, and do
something similarly slow in non-glibc. I don't see this as being a
realistic solution. Part of the point of mcel is that it's fast.
I did already do a quick perf test with cut as a proxy.
Oh that inadvertently bypassed mcel_scan in the hot path.
Let me try something better...
$ yes $(yes éééááé | head -n9 | paste -s -d,) | head -n1M > mb.in
$ hyperfine src/cut{,.orig}" -s -d $'\x80' -f2 mb.in >/dev/null"
That shows a normal build is 10% slower,
while a fully optimized build is 40% slower.
So yes that's not appropriate by default.
How about if we omit the changes to lib/mcel.h and to modules/mcel, and
keep the other changes, i.e., the changes to the test cases? That will
warn builders that their glibc is busted.
A compromise would be to add a configure check and
add the extra check only broken systems.
Especially as Bruno already has sent a patch to glibc,
so builds on newer glibc would get the faster path?
cheers,
Padraig