Skip to content

perf (evaluate): readable path fetches every page before the first asset RTT — overlap the two mapLimit phases #22

Description

@JavaGT

Filed by the Account-2 read-only amplifier (2026-09-16, HEAD f635e62). Problem: on the readable/EPUB path, all pages resolve before the first asset request starts: pageEntries = await mapLimit(spine, 4, …) completes fully (src/archive-read.mjs:114-127), then the dedup pass runs (:130-131), then assets begin (src/archive-read.mjs:137-152). A magazine pays N page-RTTs then M asset-RTTs back-to-back, although each page's refs are known the moment that page lands. Coordinator-verified against the tree.

Candidate shape: feed each page's assetRefs into a shared deduped Set+queue as pages complete, so asset RTTs overlap the page tail; preserve first-seen ordering and the existing fail-fast semantics (mapLimit/pool).

Impact: for magazine-shaped titles (large M, modest N) this could hide a meaningful fraction of the asset phase under page downloads — same shape of win as #18's entry-time prelaunch. Unmeasured; med confidence.

Evaluation question (implementation is NOT the todo until measured): is the added concurrency complexity worth it for typical M/N shapes in sample-data? Measure first in perf/archive-parallel-sim.mjs (same scenarios, before/after); adopt only on a stable ≥10% win, consistent with the recorded adoption bar (#19).

Proposed focus packet: shared asset queue fed from the page worker; harness A/B; watch ordering of fetching asset i/M logs and staging-write contention.

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions