Skip to content

perf: skip page cache allocation for in-memory databases #274

@adityamukho

Description

@adityamukho

Problem

OpenOptions::page_cache_size is respected even when opening an in-memory database via open_memory(). The PageCache struct is allocated at full capacity (default 256 pages = 1MB), but all reads hit RAM directly — the cache is never useful and wastes heap.

Proposed fix

In Minigraf::in_memory_with_options, ignore page_cache_size and allocate a zero-capacity PageCache (or skip allocation entirely). The MemoryBackend does not go through the page cache path, so this is a safe no-op change with no semantic impact.

Acceptance criteria

  • In-memory databases do not allocate the page cache regardless of page_cache_size.
  • OpenOptions::page_cache_size is documented as file-backed only.
  • Existing in-memory tests pass unchanged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    performanceBenchmark performance regressions

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions