compact
compact copied to clipboard
Memory-efficient data structures in OCaml
Compact
Memory-efficient data structures for OCaml
Currently provides the following modules:
-
Hashset
: an unordered set container. Comes with three specialisations:-
Immediate
, for elements with an immediate representation (e.g.int
). -
Immediate64
, for elements with an immediate representation on 64-bit platforms only (e.g.Int63.t
). -
Fixed_size_string
, for elements that are strings of a fixed length.
-
-
Hashtbl
: an unordered associative container. -
Hashed_container
: a generic hashtable implementation with support for externally-allocated bindings. -
Arena
: an arena for fixed-width strings; -
Uniform_array
: an array implementation that forbids the flat float array optimisation. Comes withTuple2
andTuple3
specialisations for compact arrays of pairs and triples.
See the ./bench
subdirectory for benchmarks (and benchmark
results) for the above modules.
Installation
Compact
can be installed with opam
:
opam pin add -n compact.dev git+https://github.com/CraigFe/compact
opam install compact
Acknowledgements
This library pulls code and ideas from various open-source Jane Street
libraries, including a uniform array implementation from
Base
.