Skip to content

performance: Implement arena allocator for hashtable (#2) #62

@AlexJuca

Description

@AlexJuca

Context

The current hash table allocates entries and values individually. Under high write volume this can create allocator overhead, fragmentation, and poor cache locality. An arena allocator could improve throughput and memory behavior, but it must preserve correctness for delete/update/free paths.

Scope

  • Design an arena or pool allocator for hash table entries, keys, and/or value metadata.
  • Define ownership for value payloads and deletion semantics.
  • Support safe updates and deletes without use-after-free.
  • Measure memory fragmentation and throughput before/after.
  • Ensure sanitizer and leak tests remain clean.

Acceptance criteria

  • Benchmarks show a measurable win or document why the arena approach is not worth merging.
  • Delete/update/free paths are covered by tests.
  • Memory accounting remains compatible with Add memory limits and eviction policy #73.
  • Implementation does not make future persistence or eviction work harder.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions