This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Thoughts on bug 15884


On 09/16/2014 09:20 AM, Rich Felker wrote:
I don't know what strxfrm is good for in practice.
Obviously the case where it matters is where each of your strings is
in the form of a common large prefix and a tiny difference at the end.
Here strcoll will perform pathologically bad (at least without some
kind of memoization) and strxfrm solves the problem.

I know the *theory*.  But I don't see how strxfrm is a win in *practice*.

Long ago I asked someone on the C committee why it was in the standard, and he answered that it seemed like a good idea back in the 1980s, and that it'd be too painful to remove from the C standard now. He (and I) couldn't provide any examples of it being used in practical software.

glibc dutifully implements strxfrm; but not efficiently, which is fine. Why bother to improve the performance of a function that's practically useless?

strcoll, on the other hand, is a big deal. Making it go faster would be a real win.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]