diff --git a/README.md b/README.md index 959d5a6c..aed9d58c 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,8 @@ structures comprise: - `Heap`, an imperative heap based on `SplayTree` - `Graph`, a polymorphic imperative directed graph (on top of `PHashtbl`) - `Hashset`, a polymorphic imperative set on top of `PHashtbl` +- `LazyGraph`, a lazy graph structure on arbitrary (hashable+eq) types, with +basic graph functions that work even on infinite graphs, and printing to DOT. - `FQueue`, a purely functional queue structure - `Heap`, a purely functional polymorphic heap @@ -20,7 +22,11 @@ Other structures are: - `Univ`, a universal type encoding with affectation - `Cache`, a low level memoization cache for unary and binary functions +- `PersistentHashtbl`, a semi-persistent hashtable (similar to +[persistent arrays](https://www.lri.fr/~filliatr/ftp/ocaml/ds/parray.ml.html)) - `Deque`, an imperative double ended FIFO (double-linked list) +- `Future`, a set of tools for preemptive threading, including a thread pool, +monadic futures, and MVars (concurrent boxes) - `Vector`, a growable array (pure OCaml, no C; not tested) - `FlatHashtbl`, a (deprecated) open addressing hashtable with a functorial interface (replaced by PHashtbl) diff --git a/tests/benchs.ml b/tests/benchs.ml index 115f15e7..c43a1fec 100644 --- a/tests/benchs.ml +++ b/tests/benchs.ml @@ -217,6 +217,12 @@ let skiplist_find l = ignore (SkipList.find l i); done +let array_find a = + fun n -> + for i = 0 to n-1 do + ignore (Array.get a i); + done + let _ = List.iter (fun len -> @@ -227,6 +233,7 @@ let _ = let h'''' = ifhashtbl_add len in let h''''' = ipersistenthashtbl_add len in let l = skiplist_add len in + let a = Array.init len (fun i -> string_of_int i) in Format.printf "----------------------------------------@."; Format.printf "try on size %d@.@.@." len; Bench.bench [ @@ -237,8 +244,9 @@ let _ = "ifhashtbl_find", (fun () -> ifhashtbl_find h'''' len); "ipersistenthashtbl_find", (fun () -> ipersistenthashtbl_find h''''' len); "skiplist_find", (fun () -> skiplist_find l len); + "array_find", (fun () -> array_find a len); ]) - [10;20;100;1000;10000;100000] + [10;20;100;1000;10000] (** {2 Sequence/Gen} *)