HomeFreeBSD

The current qsort(3) implementation ignores the sizes of partitions, and

Description

The current qsort(3) implementation ignores the sizes of partitions, and
always perform recursion on the left partition, then use a tail call to
handle the right partition. In the worst case this could require O(N)
levels of recursions.

Reduce the possible recursion level to log2(N) by always recursing on the
smaller partition instead.

Obtained from: PostgreSQL 9d6077abf9d6efd992a59f05ef5aba981ea32096

Details

Provenance
delphijAuthored on
Parents
rS318514: Use size_t.
Branches
Unknown
Tags
Unknown