From: Xxxx Xxxxxxxxxxx <xxxx@xxxxxxxxxxx.net>
To: mjd-perl-memoize+@plover.com
Subject: Minor Gripe
Date: Sun, 4 Jun 2006 13:54:57 -0700

Hi there,

I just discovered Memoize.pm and I think it's quite neat.  I do, however, have 
one small gripe.  Please consider the recursive fib from your docs:

sub fib {
   my $n = shift;
   return $n if $n < 2;
   fib($n-1) + fib($n-2);
}

I wanted to "see" the memoized performance, so I decided I would install under 
another name, for comparison sake:

memoize( 'fib', INSTALL => 'fastfib' );

I was surprised when fastfib was not quite as fast as I had expected.   I then 
tried:

memoize( 'fib' )

And found that this produced the expected speedup.

It took me quite to realize that, by using INSTALL, I was forgoing memoization 
on the recursive calls.  Perhaps this is obvious to some, but I think it 
warrants a sentence or two in the docs.

Great stuff though.  Truly a great idea.

Thanks,
Xxxx

