(* Dumb Fibonacci microbenchmark in OCaml. The interpreter invoked as time ocaml dumbfib.ml says fib(40) = 102334155 in about 4.02–4.07 seconds on the same machine where dumbfib.S takes 683–686 milliseconds, a roughly 6× slowdown. Compiling with ocamlc gives about 3.90–3.92 seconds. ocamlopt gives 0.724 seconds, about a 6% slowdown. *) let rec fib n = if n <= 2 then 1 else fib (n-1) + fib (n-2) and n = 40 in Printf.printf "fib(%d) = %d\n" n (fib n) ;;