coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: performance bug of `wc -m` on macOS


From: Bruno Haible
Subject: Re: performance bug of `wc -m` on macOS
Date: Mon, 21 May 2018 03:50:34 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-124-generic; KDE/5.18.0; x86_64; ; )

Pádraig Brady wrote:
> That suggests we're not replacing
> wcwidth on this OSX system, and that the system implementation
> is just very slow, which the attached patch should avoid if possible.

If we have a system where wcwidth is very slow, gnulib could
override the function with a faster implementation (like it
already does e.g. for 'strstr'). This is possible here,
because the wchar_t implementation is known (unlike older
BSDs and/or Solaris).

However, before we do this, can you please check whether it already
uses the gnulib replacement or not? ('nm src/wc | grep width')
On my macOS 10.13 system, it links in rpl_wcwidth, and therefore
the system's wcwidth performance is irrelevant (because our test
is running in an UTF-8 locale and therefore rpl_wcwidth calls
uc_width, never wcwidth).

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]