perf(catalogue): optimize stale entry git log parsing in gen-catalogue-status.py - #464
Conversation
…e-status.py - Replace 890 individual git log subprocess invocations in stale_count() with a single git log query over patterns/. - Stream-parse commit timestamps into a path lookup map, reducing gen-catalogue-status.py runtime from ~5.0s to ~0.01s. - Add unit test coverage in tools/gen-catalogue-status-test.py for stale count git log parsing. Co-authored-by: mjmirza <34001140+mjmirza@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Problem Reproduction
Executing
tools/gen-catalogue-status.pytook ~5.0s due tostale_count()issuing 890 individualgit log -1subprocess calls (one per published pattern entry file).Root Cause
stale_count()iterated over all 890 published pattern paths and ran a blockinggit log -1 --format=%ct -- <path>subprocess command for each path sequentially.Solution
stale_count()intools/gen-catalogue-status.pyto run a singlegit log --format="COMMIT %ct" --name-only -- patterns/subprocess command.tools/gen-catalogue-status-test.pytesting stale count calculations and edge cases.Measurements
dist/catalogue-status.json,docs/PROGRESS.md, andREADME.mdgenerated outputs remain identical.Security & Compatibility
Confidence Score
96/100 (Historical novelty: 25, Impact: 20, Root cause: 15, Evidence: 15, Solution: 10, Risk: 5, Maintenance: 3, Reversibility: 3)
PR created automatically by Jules for task 5077689403762783370 started by @mjmirza