Re: new module "mpsort" for faster sorting

2007-01-29 Thread Paul Eggert
Jim Meyering <[EMAIL PROTECTED]> writes: >> I was surprised to see Jim's report that the C locale made no >> difference to him, compared to the en_US.UTF-8 locale. > > I hope I didn't say that. > The only locale I tried was "C". Ah, sorry, I misremembered what you said. I just now measured with

Re: new module "mpsort" for faster sorting

2007-01-29 Thread Jim Meyering
Paul Eggert <[EMAIL PROTECTED]> wrote: > Bruno Haible <[EMAIL PROTECTED]> writes: > >> Does the major speedup come from the transition a) -> b), or from the >> transition b) -> c) ? > > I didn't code those solutions separately, so I don't know. > > I have written a replacement qsort that has the s

Re: new module "mpsort" for faster sorting

2007-01-29 Thread Paul Eggert
Bruno Haible <[EMAIL PROTECTED]> writes: > Does the major speedup come from the transition a) -> b), or from the > transition b) -> c) ? I didn't code those solutions separately, so I don't know. I have written a replacement qsort that has the same API as standard qsort, but uses mpsort internal

Re: new module "mpsort" for faster sorting

2007-01-29 Thread Bruno Haible
Jim Meyering wrote: > When sorting records larger than a pointer, reduced data movement is > likely to be the overriding factor: better use of cache. > I.e., setting up the array of pointers costs just O(N) time and memory, > but you save O(N log(N)) time in reduced data copying costs, because > mp

Re: new module "mpsort" for faster sorting

2007-01-29 Thread Jim Meyering
Bruno Haible <[EMAIL PROTECTED]> wrote: > Hello Paul, > >> Such a function can lead to faster execution >> in some important cases, as I have verified using GNU 'ls' as a guinea pig. > > Does the speedup come from the use of the mergesort algorithm, or from > avoiding a function call in the compari

Re: [bug-gnulib] new module "mpsort" for faster sorting

2007-01-29 Thread Bruno Haible
Hello Paul, > Such a function can lead to faster execution > in some important cases, as I have verified using GNU 'ls' as a guinea pig. Does the speedup come from the use of the mergesort algorithm, or from avoiding a function call in the comparison function (with qsort, the pointer indirection

new module "mpsort" for faster sorting

2007-01-28 Thread Paul Eggert
For quite some time Djamel Belazzougui has been suggesting speed improvements to glibc's qsort function. I'm not sure yet that this is a good idea, but it does seem to me that there is use for a function that can sort a vector of pointers to data (as opposed to qsort, which sorts an array of data)