perf(gptodo): 59x faster task loading by avoiding git subprocess per task#300
Merged
TimeToBuildBob merged 1 commit intomasterfrom Feb 17, 2026
Merged
perf(gptodo): 59x faster task loading by avoiding git subprocess per task#300TimeToBuildBob merged 1 commit intomasterfrom
TimeToBuildBob merged 1 commit intomasterfrom
Conversation
When tasks lack a 'modified' field in frontmatter (common — 87/87 tasks in Bob's workspace), load_tasks() was spawning 2 git-log subprocesses per task to get timestamps. With 87 tasks that's 174 subprocess calls. Fix: use file mtime as the fast fallback for missing 'modified' field. Only fall back to git when 'created' is also missing/unparseable. Before: 20.5s to load 87 tasks After: 0.35s to load 87 tasks (59x faster)
Contributor
There was a problem hiding this comment.
Important
Looks good to me! 👍
Reviewed everything up to 31e390e in 13 seconds. Click for details.
- Reviewed
55lines of code in1files - Skipped
0files when reviewing. - Skipped posting
0draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
Workflow ID: wflow_ypOB9cHC43fRck4k
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
Contributor
Greptile SummaryReplaced expensive
Confidence Score: 4/5
Important Files Changed
Flowchartflowchart TD
A[load_tasks starts] --> B[Read task file]
B --> C[Parse frontmatter metadata]
C --> D{created field<br/>in metadata?}
D -->|Yes| E[Parse created timestamp]
D -->|No| F[Use st_ctime fallback]
E --> G{modified field<br/>in metadata?}
F --> G
G -->|Yes| H[Parse modified timestamp]
G -->|No| I[Use st_mtime fallback<br/>NEW: Fast path]
H --> J[Create TaskInfo object]
I --> J
J --> K[Return task]
style I fill:#90EE90
style G fill:#FFE4B5
L[OLD: Missing modified] -.->|Used to spawn| M[git log subprocess<br/>174 calls for 87 tasks<br/>20.5 seconds]
M -.->|Removed| N[X]
style M fill:#FFB6C6
style N fill:#FF6B6B
Last reviewed commit: 31e390e |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
modifiedfield in frontmatter (common — all 87 tasks in Bob's workspace),load_tasks()was spawning 2git logsubprocesses per task to get timestampsmodifiedfield instead ofgit logBenchmark
gptodo status --compact: 21.5s → 0.3s (71x faster)Test plan
gptodo status --compactshows correct task listingImportant
Optimize task loading in
utils.pyby using file mtime instead ofgit logfor missingmodifiedfields, improving performance by 59x.load_tasks()inutils.py, replacedgit logsubprocess calls with file mtime checks for tasks missingmodifiedfield.gptodo status --compactexecution time reduced from 21.5s to 0.3s.This description was created by
for 31e390e. You can customize this summary. It will automatically update as commits are pushed.