Skip to content

perf: huge pages (MADV_HUGEPAGE) for the store table + arenas #512

Description

@ELares

Parent: #507. Cheap (est. 3-10%, low risk); do early.

Problem

The -r 1M random-key benchmark (and real skewed workloads) thrash the TLB: each GET touches a random table bucket + a random value, mostly TLB misses with 4 KiB pages. 2 MB huge pages cut the TLB-miss rate dramatically for the same coverage.

Mechanism / fix

madvise(MADV_HUGEPAGE) (transparent huge pages) on the per-shard table backing store + the value arenas, or allocate them from a huge-page-backed arena. Gate behind Linux + a config flag (default on where THP is available; a no-op elsewhere). This is a memory hint, so it does not touch ADR-0003 determinism.

Risk / notes

Acceptance

  • Table/arena backed by huge pages on Linux (verify via /proc/PID/smaps AnonHugePages).
  • No functional change; tests pass.
  • A/B target: 3-10% GET on the random-key workload.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:memoryArea: memoryenhancementNew feature or requestsub-issueGranular child task split out from a parent design issue

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions