Why
SpecFact CLI startup is currently slow (several seconds delay) due to automated checks for IDE templates and version updates running on every invocation. This degrades user experience and makes the CLI feel unresponsive. Users expect CLI tools to respond within 1-2 seconds maximum.
The current implementation:
- Checks IDE templates on every startup (file system operations, hash comparisons)
- Checks PyPI for version updates on every startup (network requests)
- Both checks block startup until completion
This change optimizes startup performance by:
- Only checking IDE templates after version updates are detected (via metadata tracking)
- Checking PyPI for updates only once per day (not every startup)
- Adding a dedicated
update command for manual update checking and installation
- Profiling and optimizing any other startup blockers
What Changes
- NEW: Metadata management module for tracking version and check timestamps in
~/.specfact/metadata.json
- MODIFY: Optimize startup checks to check metadata before running checks, add conditional execution logic
- NEW: New
specfact update command for manual update checking and installation
- MODIFY: Register update command, ensure startup checks use optimized logic
- NEW: Comprehensive tests for metadata management, update command, and startup performance
Acceptance Criteria
Performance Impact
- Startup time: Reduced from several seconds to < 1-2 seconds
- Network requests: Reduced from every startup to once per day
- File system operations: Reduced from every startup to only after version changes
OpenSpec Change Proposal: optimize-startup-performance
Why
SpecFact CLI startup is currently slow (several seconds delay) due to automated checks for IDE templates and version updates running on every invocation. This degrades user experience and makes the CLI feel unresponsive. Users expect CLI tools to respond within 1-2 seconds maximum.
The current implementation:
This change optimizes startup performance by:
updatecommand for manual update checking and installationWhat Changes
~/.specfact/metadata.jsonspecfact updatecommand for manual update checking and installationAcceptance Criteria
specfact updatecommand available for manual updatesPerformance Impact
OpenSpec Change Proposal:
optimize-startup-performance