Source

ocaml-lib / gdbm / essai.ml

open Dbm

let db = opendbm "dbessai.db" [Dbm_create; Dbm_rdwr] 0o660

let _ =
  print_endline "dbessai has been opened";
  let s = String.make (1024*1024) 'a' in
  for i = 1 to 3000 do
    add db (string_of_int i) s;
    if i mod 30 = 0 then begin print_int (i/30); print_endline "%"; flush stdout end
  done;
(*
  for i = 1 to 100000 do
    ignore (find db (string_of_int i))
  done;
*)
  close db;
  print_endline "dbessai has been closed"