Working with large directories

Cameron Simpson cs at zip.com.au
Sat Mar 17 07:48:33 UTC 2012


On 16Mar2012 23:49, fred smith <fredex at fcshome.stoneham.ma.us> wrote:
| On Fri, Mar 16, 2012 at 09:39:03PM -0430, Patrick O'Callaghan wrote:
| > If that were so, 'ls' would take as long as Nautilus (or Dolphin or
| > whatever) to list a large directory. I don't have any huge directories
| > to test, but I'm sceptical.
| 
| Hmm. you do seem to be correct:
| 
| 	time ls | wc -l
| 	105612
| 
| 	real    0m2.582s
| 	user    0m2.429s
| 	sys     0m0.163s
| 
| I know that on (much) older systems, large directories were inherently
| slow to traverse. I guess I shouldn't assume that is still the case.

Gah. Please compare apple with apples.

Run the same test with "ls -l" and compare, then think about the
difference.

The consider that many GUI browsers try to give cues that a directory
has contents - that needs even more work.

Finally, run strace against Nautilus and other tools and see how much
real work they're doing. It can be illuminating.

Cheers,
-- 
Cameron Simpson <cs at zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/

The reason that God was able to create the world in seven days is that he
didn't have to worry about the installed base.  - Enzo Torresi


More information about the users mailing list