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

Re: HFS problems



Nathan Mates <nathan@visi.com> wrote:

>   Writing the HFS's B-tree to disk is far more complicated than
> writing a linear chunk of memory-- the B-tree is stored in another
> b-tree. As memory access speeds are far greater than disk i/o speeds
> (especially for large linear read/werites on modern caching HDs),
> blowing your directory all over the disk by default is a performance
> hit. 

This is one reason why the Mac pre-allocates a lot of space to at least
one (if not both) of the HFS B-Trees.  It is all in one area, so if a
lot of updating is needed, the head doesn't have to move very far.

If a large number of extents or files are added, then the trees will
start to get fragmented, which will introduce a performance hit.

>   B-Trees may be nice when in memory

Hardly.  Binary trees or AVL trees are easier to deal with.  B-Trees are
more suited for use on disks, because they clump data in conveniently
sized blocks, and in theory require less index levels (i.e. reads to
locate an entry), and are faster to update.

-- 
David Empson
dempson@actrix.gen.nz
Snail Mail: P.O. Box 27-103, Wellington, New Zealand