Skip to content

perf: bound and reuse immutable page payload reads #85

Description

@flyingrobots

Problem

PageService.get() validates immutable page metadata through bounded caches but invokes a fresh git cat-file blob for every payload read. Repeated exact reads in git-warp therefore pay process and I/O overhead even when the page OID is unchanged and retained. A measured 16-read retained-property workload issued 32 blob reads and took 2.61 s wall-clock; time to first reading was 1.80 s.

Contract

Add bounded in-process reuse for successful immutable page payload reads. The cache must be bounded by entry count and total bytes, share in-flight work, evict least-recently-used entries, remove rejected work immediately, and never expose mutable cached bytes to callers. Streaming pages.open() remains streaming and must not silently buffer arbitrary payloads.

Acceptance criteria

  • PageService.get() reuses successful immutable payload reads by page OID.
  • Residency is bounded independently by entry count and byte weight.
  • Returned bytes cannot mutate cached bytes or later results.
  • Failed reads are retryable and are not cached.
  • Oversized values serve the current caller without evicting unrelated residents.
  • pages.open() retains its streaming contract.
  • A real-Git integration test proves an identical warm get() performs zero additional Git commands.
  • Public configuration, docs, release notes, and type declarations accurately describe the bounds.

Downstream

Blocks git-warp v19 performance issues git-stunts/git-warp#759, #760, and #761.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:runtimeRuntime portability or public API behaviorarea:storageStorage, Git objects, manifests, or persistencestatus:in-progressActively being workedtype:bugIncorrect behavior or regressiontype:goalpostRelease-scale roadmap outcometype:sliceTurn-sized proof work under a goalpost

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions