Skip to content

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

Open

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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