package plebeia

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

1 Cache for small values

This module provides hash-consing of small Leaf values under max_leaf_size of config.

type t

2 Configuration

type config = {
  1. max_leaf_size : int;
    (*

    Maximum size of leaf value stored in bytes

    *)
  2. max_bytes_commit : int;
    (*

    shrink wipes unpopular data when the size of t when the table exceeds this amount of bytes

    *)
  3. max_bytes_absolute : int;
    (*

    add wipes unpopular data when the size of t when the table exceeds this amount of bytes

    *)
  4. shrink_ratio : float;
}
val config_enabled : config
val config_disabled : config
val check_config : config -> (unit, unit) Stdlib.result
val config : t -> config

Get the config

2 Table

val create : config -> t

Create an empty hashcons table. To load the existing hashconsed table from the storage, read must be used.

val find : t -> Value.t -> (Index.t option, Error.t) Result.t

Find the hasheconsed value from the table

val add : t -> Value.t -> Index.t -> (unit, Error.t) Result.t

Register a value from the table

2 Statistics

val stat : Stdlib.Format.formatter -> t -> unit

Print out statistics

val estimated_size_in_bytes : t -> int

Estimated size of the table in bytes. It returns 98-101% of the real size.

val shrink : t -> unit
OCaml

Innovation. Community. Security.