From: Takaaki Tateishi Date: 2002-08-11T03:51:37+09:00 Subject: Re: optimization module and tail recursion At Sat, 10 Aug 2002 22:26:28 +0900, > Great!!! - This ought to become a part of the standard libray at > some point IMO. Thanks, > Here are is the benchmark for the picture perfect candidate of tail > recursion ... Didn't you forget to use 'optimize :__fib_tail' and 'instance_optimize :__fib'? I got the following result: fib(29) 2.680000 0.070000 2.750000 ( 2.759829) fib_tail(29) 0.000000 0.000000 0.000000 ( 0.000091) fib_no_rec(15000) 0.080000 0.020000 0.100000 ( 0.101072) fib_tail(15000) 0.100000 0.010000 0.110000 ( 0.126680) 15000.fib_tail fib.rb:27:in `__fib': stack level too deep (SystemStackError) -- Takaaki Tateishi