ocaml-multicore/domainslib

fibonacci example

sanette opened this issue · 1 comments

Just a stupid remark about the README file.
I know this is just for illustration, but choosing fib is could lead to questions here; maybe somewhere in the README one could mention that the usual sequential code is much faster

let fib n = let rec loop n = if n < 1 then (0, 1) else let x, y = loop (n-1) in y, (x+y) in snd (loop n);;
Kakadu commented

Actually, the 92th fibonacci number is 2880067194370816120 and next one exceeds max_int. So for production-ready performant implementation a lookup table should be recommended :)