Subject: Re: Re: Shrinking ext3 directories

On Jun 23, 2002 09:57 +0200, Daniel Phillips wrote:
> At the end of the overnight run with about 16,600 cycles another block has
> been added, bringing the directory up to 397312 bytes. The four points I
> have now make a nice logarithmic curve, i.e., the slope seems to fall off so
> rapidly that there is not a lot to worry about here. All the same, I should
> code a more efficient test and run a few billion cycles. Or perhaps that
> same effort would be better spent working on the coalesce, which will turn
> this into a moot point.

You could probably just allocate an array of N fixed-length filenames,
and then just do the following for a _much_ faster algorithm:

memset(*names, 0, N * namelen);
for (i = 0; i < cycles; i++) {
next = rand() % N;
if (names[next][0])

For 100k steady-state filenames this will only be a couple MB in the array.
You can also do more to make the entire name random, because you have an
O(1) lookup for existing file names, so it doesn't really matter how
strange they are.

Now you have time to code the coalesce ;-).

Cheers, Andreas
Andreas Dilger

Sponsored by:
ThinkGeek at