Skip to content

FOLLOW-UP: Per-page read cache in include.Preprocess (from PR #256) #265

Description

@adnaan

Context

PR #256's include.Preprocess reads files via readFileBounded for each include block.

Source PR: #256
Suggested by: @claude[bot]
Comment type: PR review (round 3)

Task Description

Two include=\"./same.go\" blocks within the same page (e.g., showing different ranges of the same file) cause two os.ReadFile calls. Acceptable for v1 page sizes; an in-render-pass cache would be a small optimization if large pages with many same-file slices become common.

Implementation: a small map[string][]byte scoped to a single Preprocess call.

Original Comment

No caching of repeated includes within a page: two include=\"./same.go\" blocks cause two os.ReadFile calls. Acceptable now, but a single-page read-cache in Preprocess would be a small optimization if large pages become common.
@claude[bot], round 3


Auto-created by /prmonitor from PR review comments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4-backlogBacklog: future, nice-to-havefollow-upFollow-up task from PR reviewfrom-reviewIssue originated from PR review

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions