Re: directory ops?

Alexander Viro (viro@math.psu.edu)
Wed, 2 Jun 1999 04:18:07 -0400 (EDT)


On Wed, 2 Jun 1999, Larry McVoy wrote:

> I was chatting with tchrist (the perl guy) today and he mentioned that
> BSD does a better job of very large directory handling than Linux. The
> suggested test was to create a directory with 10,000 files in it and
> compare
>
> ls -l
> ls -l first_file
> ls -l middle_file
> ls -l last_file
>
> under both BSD and Linux.
>
> Has anyone done this? If this is an area where we need some work, I'll
> add the appropriate test to lmbench.

Under which filesystem? Aside of one optimization we might do and BSD does
for some filesystems (memorizing last lookup position for a while and
restarting lookup from that place) I'ld say that claim is pure BS.
->readdir() in *BSD doesn't populate per-fs directory caches, so he
might have a point with 2.0.x - there we used to do stupid things like
that (with dcache) and ls -l on large directory might cause massive dcache
sweep. Doesn't happen with 2.2/2.3.

Adding the test will not hurt, indeed. Doing it accurately might be
tricky, though. E.g. ls -l sorts the entries. In userspace. So you'll have
to factor that out - I doubt that GNU ls does bogosort, but...

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/