[Shootout-list] ackermann, fibonacci and takfp benchmarks

Einar Karttunen ekarttun@cs.helsinki.fi
Sat, 19 Mar 2005 11:06:44 +0200


"=A4WildCard=A4" <WildCard_25@HotMail.Com> writes:
> These benchmarks are testing recursion into a function. Shouldn't there=
=20
> be an output of the number of times the function is called and possibly=
=20
> the maximum depth of recursion as well (these are distinct for each N).=
=20
> This will also provide a quick way of checking if the program is taking=
=20
> shortcuts that it shouldn't.
>
> Easy to add to existing programs. At the start of each function.
> recursion +=3D 1;
> depth +=3D1;
> if (depth > maxdepth) {maxdepth =3D depth;}

This is actually more expensive than recursion in many languages.

- Einar Karttunen