3 ms·
Yeah, startup and compilation time in Julia is not a big deal. One could even make the compiler work a bit harder, but you would have to ask a lawyer if this st
by shele 8y ago
Yeah, startup and compilation time in Julia is not a big deal. One could even make the compiler work a bit harder, but you would have to ask a lawyer if this still counts as recursion ;-)
julia> function fib(::Val{n}) where n
if n <= 1 return 1 end
return fib(Val(n - 1)) + fib(Val(n - 2))
end
julia> fib(n) = fib(Val(n))
julia> @time fib(46) # Compilation and execution
0.095409 seconds