bug-coreutils
[Top][All Lists]
Advanced

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

Re: coreutils and i18n


From: Bruno Haible
Subject: Re: coreutils and i18n
Date: Mon, 21 Apr 2008 13:03:38 +0200
User-agent: KMail/1.5.4

Jim Meyering wrote:
> >   - Processing in unibyte locales should not become significantly slower
> >     than before.
> >   - Code duplication should be avoided, for maintainability.
> >   - Macros which expand to one thing in the multibyte case and to another
> >     thing for the unibyte case are not acceptable.
> >
> > How will this students' project solve this dilemma?
> 
> There's no guarantee, but Paul and I will be supervising.

I mean, what is technically the solution to the dilemma? The typical idiom
for keeping the speed of the unibyte case is - see e.g. gnulib/lib/mbscasecmp.c
as an example -

  #if HAVE_MBRTOWC
    if (MB_CUR_MAX > 1)
      ... multibyte case ...
    else
  #endif
      ... unibyte case ...

but it does have code duplication.

What approach are they going after? Put a big

  switch (c)
    {
    case 'A'..'Z':
      ... handle printable ASCII characters ...
    default:
      ... handle multibyte case ...
    }

into every loop? This approach has not even sufficed for lib/mbswidth.c.

Do they want to speed up the multibyte case code by some tricks?

Or are you giving up one of the three requirements? If so, which one?

Bruno





reply via email to

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