Re: ext4/reiser3/btr directory create/read perf

From: Theodore Tso
Date: Wed Sep 30 2009 - 18:34:56 EST


On Wed, Sep 30, 2009 at 09:44:04PM +0200, wbrana@xxxxxxxxx wrote:
>
> Times with 1000 directories and dir_index enabled
> /mnt/md8: 64 kB chunks
> reiser3
> void cfs::vdirs_create(): 973 msec
> void cfs::vdirs_read(): 60 msec
> ext4
> void cfs::vdirs_create(): 2435 msec
> void cfs::vdirs_read(): 3326 msec
> btrfs
> void cfs::vdirs_create(): 1036 msec
> void cfs::vdirs_read(): 155 msec
>
> ext4 was 55 times slower than reiser3 in vdirs_read()

On a micro brenchmark, simply creating an empty directory will much
faster in pure b-tree oriented filesystems, since it's just a node
insert. So yes, reiser3 will always be faster for mkdir(), and
there's not much that can be done about it.

I suppose we could implement XFS-style short-form directories (where
the directory is stored in i_blocks, which would work for directories
with 4 or fewer directory entries with short names), but it's not
clear it's really worth it, since in practice, there are very few
directories that have really small number of entries, and there's a
lot more regarding real-world performance than just creating empty
directories.

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