-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
featureNew featureNew feature
Milestone
Description
Problem
As the template library grows, the compose list command (and other module list commands) becomes noticeably slower. Currently, the CLI checks the draft status of every template directory by parsing YAML files, which scales linearly with template count.
Current performance:
- 34 templates (20 drafts + 14 published): ~230ms
- Projected with 100 templates: ~700ms
- Projected with 300 templates: ~2+ seconds
The bottleneck occurs because we:
- Iterate through all template directories
- Open and parse each
template.yamlfile to checkmetadata.draftstatus - Parse YAML for templates that won't even be displayed (drafts)
This happens on every list command, even though draft status rarely changes.
User Impact
- Slower command response times as library grows
- Poor user experience with large template collections
- Wasted I/O and CPU on unchanged data
- Scales poorly with multiple libraries
When to Address
This optimization should be implemented before the library reaches 100+ templates or when users report noticeable slowdown in list commands.
Context
Performance analysis and potential solutions have been documented in PERFORMANCE_OPTIMIZATION_PLAN.md. The refactoring should maintain backward compatibility while significantly improving template discovery performance.
Metadata
Metadata
Assignees
Labels
featureNew featureNew feature