I also found wcwidth to be a bad performance bottleneck in my multibyte
branch of coreutils. To fix the problem in my branch, I added a cache of
the widths returned for characters in the range from 0 to UCHAR_MAX (which
perhaps should also be widened to include a few other common alphabets).
The caching code is at the bottom of


https://github.com/ericfischer/coreutils/blob/multibyte-squash/src/widetext.c

and you are welcome to it (and any of the other internationalization fixes)
if you want.

Eric

Reply via email to