Documentation ¶
Overview ¶
Package bigmap implements a custom hashmap data structure where keys and values are binary and keys are meant to be well-distributed hashes, such as content IDs, object IDs, etc.
Unlike regular maps this map is limited to adding and getting elements but does not support any iteration or deletion, but is much more efficient in terms of memory usage.
Data for the hash table is stored in large contiguous memory blocks (for small sets) and automatically spills over to memory-mapped files for larger sets using only 8 bytes per key in RAM.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Map ¶
type Map struct {
// contains filtered or unexported fields
}
Map is a wrapper around internalMap that adds encryption.
func NewMapWithOptions ¶
NewMapWithOptions creates new Map with options.
type Options ¶
type Options struct { LoadFactorPercentage int // grow the size of the hash table when this percentage full NumMemorySegments int // number of segments to keep in RAM MemorySegmentSize int64 // size of a single memory segment FileSegmentSize int // size of a single file segment, defaults to 1 GiB InitialSizeLogarithm int // logarithm of the initial size of the hash table, default - 20 }
Options provides options for the internalMap.
type Set ¶
type Set struct {
// contains filtered or unexported fields
}
Set is a wrapper around Map that only supports Put() and Contains().
func NewSetWithOptions ¶
NewSetWithOptions creates new Set with options.
Directories ¶
Path | Synopsis |
---|---|
Command bigmapbench provides a benchmark for the bigmap implementation.
|
Command bigmapbench provides a benchmark for the bigmap implementation. |