[lkml]   [2008]   [Apr]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: stat benchmark
On Mon, Apr 28, 2008 at 1:29 AM, Soeren Sandmann <> wrote:
> For a directory of ~2360 files, chunks of a 1000 files is actually
> surprisingly worse than statting all of the files at once:
> Time to stat 1000 files: 1.008735 s
> Time to stat 1000 files: 0.738936 s
> Time to stat 366 files: 0.217002 s
> I guess this just shows that seeks really is pretty much all that
> matters. Glib should maybe use a larger chunk size.

I agree, if I remember correctly I did not find a directory on my local
disk where the best result was to sort a chunk instead of the complete

> I don't know if a general library outside glib would be useful. It
> seems that just telling people to "sort by inode before statting"
> would be just as effective as telling them "use this optimized
> library".

A library (like glib) could disable the feature for solid-state drives
and perhaps implement an alternative strategy for filesystems without
any inode/sector correlation.

So I think we should tell people to use glib. :-)

Carl Henrik

 \ /
  Last update: 2008-04-28 02:17    [W:0.051 / U:0.176 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site