Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Apr 1997 13:18:33 -0700
From:      David Greenman <dg@root.com>
To:        Poul-Henning Kamp <phk@dk.tfs.com>
Cc:        fs@freebsd.org
Subject:   Re: the namei cache... 
Message-ID:  <199704242018.NAA10732@root.com>
In-Reply-To: Your message of "Thu, 24 Apr 1997 21:40:49 %2B0200." <1303.861910849@critter> 

next in thread | previous in thread | raw e-mail | index | archive | help
>In message <199704241934.MAA10488@root.com>, David Greenman writes:
>>>about 1/4th of the additions. Getting reed of the div wouldn't also be bad
>>>but might not be worth it.
>>
>>   Not worth it? At greater than 50 cycles, the divide is more expensive
>>than the entire add loop.
>
>But loosing the hash entirely is >even< faster, right ?  :-)

   Maybe. Here's the problem with your approach as I see it: On wcarchive,
we have about 44,000 files in the namei cache. The hash table size is
approximately 44,000 entries large (rounded up or down to the nearest
prime...I forget). This means that there is an average of about 1 file in
each hash bucket...or very little to search through. Of course there are
far fewer than 1 directory per file, so now if you change this so that all
of the files for a directory are on one list, then you're going to have to do
a lot more work to find it. I think the average directory length on wcarchive
is about 50 files or so, so this would be about 50 times more entries in the
list compared to the old hash table scheme.

-DG

David Greenman
Core-team/Principal Architect, The FreeBSD Project



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199704242018.NAA10732>