[PATCH v3 0/7] Use introsort for qsort
Adhemerval Zanella
adhemerval.zanella@linaro.org
Mon Sep 6 18:19:28 GMT 2021
On 06/09/2021 14:03, Zack Weinberg via Libc-alpha wrote:
> On Mon, Sep 6, 2021, at 10:13 AM, Carlos O'Donell via Libc-alpha wrote:
>>
>> In general I think glibc should provide a qsort that is:
>>
>> - Safe.
>>
>> - Does not have quadratic performance behaviour.
>>
>> If we want better performance we need to:
>>
>> - Add new APIs mirroring what BSD is doing.
>>
>> - New APIs explicitly call out the *type* of sort algorithm.
>>
>> - Encourage developers and application authors to contribute those
>> new implementations and use them in their applications.
>
> Do you have a link or other reference for these new APIs being developed by the BSDs?
>
> (asking out of curiosity; I haven't been following this discussion closely enough to have an opinion)
>
The FreeBSD provides qsort, which implements a quicksort, heapsort,
and mergesort [1].
[1] https://www.freebsd.org/cgi/man.cgi?query=qsort&sektion=3&manpath=freebsd-release
More information about the Libc-alpha
mailing list