[Shootout-list] ackermann, fibonacci and takfp benchmarks
¤WildCard¤
WildCard_25@HotMail.Com
Sat, 19 Mar 2005 17:38:23 +1000
These benchmarks are testing recursion into a function. Shouldn't there
be an output of the number of times the function is called and possibly
the maximum depth of recursion as well (these are distinct for each N).
This will also provide a quick way of checking if the program is taking
shortcuts that it shouldn't.
Easy to add to existing programs. At the start of each function.
recursion += 1;
depth +=1;
if (depth > maxdepth) {maxdepth = depth;}
at the end of the function
depth -= 1;
recursion, depth, maxdepth are initialized to 0 before first call.
recusion and maxdepth can then printed out with the result.
Daniel South