maph 1.0.0 High-Performance Memory-Mapped Key-Value Database with O(1) Lookups

Loading...
Searching...
No Matches
Classes | Namespaces
maph_hybrid.hpp File Reference

Hybrid static/dynamic hash with perfect hash for hot keys. More...

`#include <sys/mman.h>`
`#include <fcntl.h>`
`#include <unistd.h>`
`#include <cstring>`
`#include <atomic>`
`#include <chrono>`
Include dependency graph for maph_hybrid.hpp:

Go to the source code of this file.

## Classes
struct | maph::HybridSlot
struct | maph::HybridHeader
class | maph::HybridMaph
struct | maph::HybridMaph::Stats

## Namespaces
namespace | maph

## Detailed Description

Hybrid static/dynamic hash with perfect hash for hot keys.

Key insight: Store (key_hash, value) instead of just value

- Detect empty slots (hash == 0)
- Add new keys dynamically with probing
- Optional expiration timestamps
- Perfect hash for hot path, dynamic for long tail

Definition in file maph_hybrid.hpp.

## Class Documentation

## ◆ maph::HybridHeader

struct maph::HybridHeader

Definition at line 49 of file maph_hybrid.hpp.

Collaboration diagram for maph::HybridHeader:

Class Members
atomic< uint64_t > | generation {0} |
uint32_t | magic {0x4D415048} |
double | max_load_factor {0.75} |
atomic< uint64_t > | num_dynamic {0} |
uint64_t | num_slots {0} |
uint64_t | num_static {0} |
char | padding[464] {} |
uint32_t | version {2} |

## ◆ maph::HybridMaph::Stats

struct maph::HybridMaph::Stats

Definition at line 307 of file maph_hybrid.hpp.

Collaboration diagram for maph::HybridMaph::Stats:

Class Members
size_t | avg_probe_distance |
size_t | dynamic_slots |
size_t | expired |
double | load_factor |
size_t | static_slots |
size_t | total_slots |
size_t | used_dynamic |
size_t | used_static |