This is a performance win on GLIBC,
as tested on the coreutils multi-byte update to cut(1):
$ yes $(yes éééááé | head -n9 | paste -s -d,) |
head -n1M > mb.in
$ time LC_ALL=C.UTF-8 src/cut-before -c1 mb.in >/dev/null
real 0m1.582s
$ time LC_ALL=C.UTF-8 src/cut-after -c1 mb.in >/dev/null
real 0m0.592s
* lib/mcel.h: While GLIBC's mbrtoc32 is functional for mcel,
it is seen to be 2.6x slower than gnulib's implementation
due to GLIBC's per call locale handling.
+2026-04-05 Pádraig Brady <P@draigBrady.com>
+
+ mcel: remove forced use of GLIBC's mbrtoc32
+ * lib/mcel.h: While GLIBC's mbrtoc32 is functional for mcel,
+ it is seen to be 2.6x slower than gnulib's implementation
+ due to GLIBC's per call locale handling.
+
2026-04-04 Bruno Haible <bruno@clisp.org>
posix_spawn-internal: Remove a FIXME.
return _GL_LIKELY (0 <= c && c < MCEL_ERR_MIN);
}
-/* With mcel there should be no need for the performance overhead of
- replacing glibc mbrtoc32, as callers shouldn't care whether the
- C locale treats a byte with the high bit set as an encoding error. */
-#ifdef __GLIBC__
-# undef mbrtoc32
-#endif
-
/* Scan bytes from P inclusive to LIM exclusive. P must be less than LIM.
Return the character or encoding error starting at P. */
MCEL_INLINE mcel_t