Module Fast_hashtbl


module Fast_hashtbl: sig .. end
Hashtbl which stores a reference to the data for faster replace. Initial adds are _marginally_ slower, while replace is way faster. Lookups etc. are the same.

type ('a, 'b) t 
val sexp_of_t : ('a -> Sexplib.Sexp.t) ->
('b -> Sexplib.Sexp.t) -> ('a, 'b) t -> Sexplib.Sexp.t
val create : int -> ('a, 'b) t
val clear : ('a, 'b) t -> unit
val add : ('a, 'b) t -> key:'a -> data:'b -> unit
val find_exn : ('a, 'b) t -> 'a -> 'b
val find : ('a, 'b) t -> 'a -> 'b option
val mem : ('a, 'b) t -> 'a -> bool
val remove : ('a, 'b) t -> 'a -> unit
val replace : ('a, 'b) t -> key:'a -> data:'b -> unit
val iter : f:(key:'a -> data:'b -> unit) -> ('a, 'b) t -> unit
val fold : f:(key:'a -> data:'b -> 'c -> 'c) -> ('a, 'b) t -> init:'c -> 'c
val length : ('a, 'b) t -> int