Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Jun 2005 10:46:14 +0300
From:      Giorgos Keramidas <keramida@freebsd.org>
To:        Dag-Erling Sm?rgrav <des@des.no>
Cc:        freebsd-fs@freebsd.org, Randy Bush <randy@psg.com>, FreeBSD Current <freebsd-current@freebsd.org>, Robert Watson <rwatson@freebsd.org>, Julian Elischer <julian@elischer.org>, Eric Anderson <anderson@centtech.com>
Subject:   Re: you are in an fs with millions of small files
Message-ID:  <20050608074613.GA979@orion.daedalusnetworks.priv>
In-Reply-To: <86ll5lmhs3.fsf@xps.des.no>
References:  <17059.7150.269428.448187@roam.psg.com> <42A4D5D0.9040500@elischer.org> <42A59367.6060307@centtech.com> <20050607175242.D61131@fledge.watson.org> <86ll5lmhs3.fsf@xps.des.no>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2005-06-08 09:25, Dag-Erling Sm?rgrav <des@des.no> wrote:
>Robert Watson <rwatson@FreeBSD.org> writes:
>> - Some appliations behave poorly with large trees.  ls(1) is the classic
>>    example -- sorting 150,000 strings is expensive, and should be avoided.
>
> That's because fts's sorting code is brain-dead.  It starts by reading
> the entire directory into a linked list, then copies that list into an
> array which it passes to qsort(), and finally converts the array back
> into a linked list.

Is there a better way to sort a linked list (not necessarily a
singly-linked list, like the one fts_link is used for).  If it makes
things easier on the sorting side, we could always convert fts_link to a
real `LIST_ENTRY(FTSENT) fts_link', but I suspect that sorting would
still involve at least some sort of array, unless we stop using qsort().




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050608074613.GA979>