darcsweb - reviews/post-codex-webapp.md

[root] / reviews / post-codex-webapp.md
# Web Application Review

## Performance Issues

### Finding 1
1. Severity: Medium
2. File and line: `src/DarcsWeb/Darcs.hs:205`, `src/DarcsWeb/Darcs.hs:387`, `src/DarcsWeb/Html.hs:112`, `src/DarcsWeb/Html.hs:124`
3. The issue: Inferred from code: the new `getRepoSummary` path still builds `extractPatchListing` for the entire history, and `extractPatchListing` renders `summary p` for every patch. The summary page only uses the first 10 recent entries plus at most 5 tags, and it does not render `psSummary` at all, so most of that work is discarded before any HTML is produced.
4. Why it matters for users: `/repo/:name/summary` will still have avoidable CPU time and TTFB on repositories with long histories. That is most visible on mobile connections, where the page feels slow even though the rendered UI is small.
5. A practical fix: add a lighter-weight summary-specific extractor that collects only the fields the page actually renders, keeps only the first 10 recent patches, and stops tag collection after 6 items so the template can still decide whether to show the `all tags...` link without materializing every tag summary.