package plebeia

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

Module Plebeia.HashconsSource

1 Cache for small values

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

Sourcetype t

2 Configuration

Sourcetype 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;
}
Sourceval config_enabled : config
Sourceval config_disabled : config
Sourceval check_config : config -> (unit, unit) result
Sourceval config : t -> config

Get the config

2 Table

Sourceval create : config -> t

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

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

Find the hasheconsed value from the table

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

Register a value from the table

2 Statistics

Sourceval stat : Format.formatter -> t -> unit

Print out statistics

Sourceval estimated_size_in_bytes : t -> int

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

Sourceval shrink : t -> unit
OCaml

Innovation. Community. Security.