Skip to content

perf: cache directory git update dates during catalog generation - #6677

Open
DBCoordinator wants to merge 1 commit into
github:mainfrom
DBCoordinator:perf/cache-directory-last-updated-main
Open

DBCoordinator wants to merge 1 commit into
github:mainfrom
DBCoordinator:perf/cache-directory-last-updated-main

Conversation

@DBCoordinator

Copy link
Copy Markdown

Summary

Cache the latest Git modification date for each directory once, avoiding a repeated full scan of the Git-date map for every plugin and canvas entry.

Why this is the highest-impact/lowest-effort change

Directory metadata generation previously scanned every Git file for every plugin/canvas, which grows approximately as directories multiplied by files. Building one prefix index turns each lookup into a constant-time Map lookup.

Verification

  • git diff --check passes
  • Full Node test/build verification could not be run because Node.js is not available in this Windows environment

Additional performance opportunities identified

  1. Precompute plugin/canvas directory dates once (this PR)
  2. Parallelize independent Pagefind HTML indexing batches
  3. Memoize catalog facet derivation across repeated renders
  4. Debounce static in-memory catalog filtering after keystrokes
  5. Add fetch caching for reusable GitHub raw file results
  6. Reuse parsed markdown for non-primary skill/cookbook assets
  7. Throttle and coalesce detail-page scroll geometry measurements
  8. Use requestIdleCallback for noncritical Pagefind result enrichment
  9. Avoid rebuilding catalog locale and category maps for every search keystroke
  10. Parallelize independent website data parsers in the generation script

Build a one-time directory date index for website metadata generation instead of rescanning the Git date map for every plugin and canvas.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@DBCoordinator
DBCoordinator requested a review from a team as a code owner November 30, 2026 14:19
Copilot AI adaptive review requested due to automatic review settings November 30, 2026 14:19
@github-actions github-actions Bot added merge-risk:high ready-for-review Submission passed intake validation and is ready for maintainer review labels Nov 30, 2026
@github-actions

github-actions Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

🚦 Submission status: 👀 Ready for review

Risk tier: merge-risk:high — Privileged execution, automation, or review-policy change
Required to merge: passing submission-gate checks plus 1 approval from reviewers with write access, including a maintainer with admin or maintain permission.

Why this tier
  • .github/scripts/catalog/generate-website-data.mjs is a high-risk path (automation, scripts, MCP config, hooks, or review policy)

Automated checks

Check Status Details
Line endings ✅ Passed Passed · logs
Spelling ✅ Passed Passed · logs
Contributor reputation ✅ Passed Passed · logs
Duplicate resource scan ✅ Passed Passed · logs
PR quality signal ⏭️ Skipped Skipped by its workflow · logs

Review

  • Approvals: 0/1
  • Assigned reviewer: not assigned yet — comment /request-review to ask for one
  • Review target date: not set
  • Still needed: 1 more approval(s); an approval from a maintainer with admin or maintain permission
  • The core-maintainers pool is not staffed yet; an approver with admin or maintain permission is required instead.

Commands

Command Who What it does
/rerun-checks PR author, maintainers Re-runs failed or incomplete checks and re-evaluates this gate
/request-review PR author, maintainers Asks the review rotation to assign a reviewer (adds needs-reviewer)

Updated for eb4c8d2 · gate run · This comment is maintained automatically — see submission gate docs.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The directory-date caching change has no active review issues.

No open issues 🎉

What changed in this PR

This PR speeds up website catalog generation by caching directory-level Git modification dates used by plugin and canvas entries.

Changes:

  • Builds a latest-date index for directory prefixes once per Git-date map.
  • Reuses the index through a WeakMap, replacing repeated full scans with direct lookups.
  • Normalizes file and directory paths for consistent cache keys.
File Description
.github/​scripts/​catalog/​generate-website-data.mjs Adds a cached directory-date index for catalog metadata lookups.

Review effort: Balanced (adaptive)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk:high ready-for-review Submission passed intake validation and is ready for maintainer review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants