perf: build git last-modified map in one pass#837
Conversation
Replace ~314 `git log` spawns per gen script with a single `git log --name-only` pass, memoised per process. Cuts gen:last-updated + gen:sitemap from ~15s to ~1.5s. Output is byte-identical to the per-file version; still degrades to no-dates when git is unavailable (e.g. the Docker image).
|
Warning Review limit reached
Next review available in: 14 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Why
gen:last-updatedandgen:sitemapeach spawngit logonce per MDX file (~314 spawns each, ~628 total) to read last-modified dates. That's ~15s on every build — local, PR CI, and dev.First of a short series addressing slow docs builds/deploys.
What
scripts/git-dates.mjs— addbuildGitDateMap(): a singlegit log --name-onlypass building apath → datemap, memoised per process. git log is reverse-chronological, so first-seen date per path == whatgit log -1 -- <path>returned.generate-last-updated.mjs/generate-sitemap.mjs— look dates up from the map instead of spawning per file.Impact
gen:last-updatedgen:sitemapSafety
last-updated-routes.mjsandsitemap.xmlagainst a baseline — no diff).Test plan
gitto fail)pr-buildCI green (fullnpm run build)