(* Baseline: memoized fibonacci using Hashtbl *)
let cache = Hashtbl.create 16 ;;

let rec fib n =
  if n < 2 then n
  else
    match Hashtbl.find_opt cache n with
    | Some v -> v
    | None ->
      let v = fib (n - 1) + fib (n - 2) in
      Hashtbl.add cache n v ;
      v
;;

fib 25
