Ernst Rohlicek jun. a écrit :
> Hello list,
>
> I'm just trying out Neko and benchmark it a bit :-)
>
> A little question here: How to define recursive functions efficiently?
> Something like:
The best is to use globals, so simply remove the "var" and use "nfibs" :
fib = function(n) {
if( n < 2 ) return 1;
return fib(n-1) + fib(n-2);
}
Also, there's already some of the shoutout benchs available in the
neko/src/benchs directory of Neko sources tgz.
Nicolas
--
Neko : One VM to run them all
(http://nekovm.org)