bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ls -i inefficiency


From: Jim Meyering
Subject: Re: ls -i inefficiency
Date: Sat, 25 Feb 2006 12:54:33 +0100

address@hidden (Eric Blake) wrote:
> On platforms with a working dirent.d_ino, 'ls -i' is
> wastefully calling [l]stat() to get the inode number
> rather than using the d_ino obtained from the
> readdir().
>
> The code currently has format_needs_stat and
> format_needs_type; it sounds like we also need
> format_needs_inode with the fallback that on
> platforms without d_ino, format_needs_inode
> implies format_needs_stat.

Thanks for the suggestion.
If this isn't too invasive, I'm interested.
I think `ls -i' (without some other option requiring stat info)
is used far less often than, say `ls -F', so it's harder to justify
adding much complexity to optimize for this relatively unusual case.

Of course, if there are applications that commonly use `ls -i' on
large hierarchies, then it would be easier to justify bigger changes.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]