Skip to content

Commit 45a28c0

Browse files
Copilotrajbos
andcommitted
Add documentation and performance tests for file caching feature
Co-authored-by: rajbos <6085745+rajbos@users.noreply.github.com>
1 parent 7e1cd0b commit 45a28c0

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,13 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
66

77
## [Unreleased]
88

9+
### Added
10+
- Intelligent file caching to improve performance when processing session files
11+
- Cache management with automatic size limits and cleanup of non-existent files
12+
- Cache hit/miss rate logging for performance monitoring
13+
14+
### Changed
15+
- Session file processing now uses cached data when files haven't been modified
16+
- Reduced file I/O operations during periodic updates for better performance
17+
918
- Initial release

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ A VS Code extension that shows your daily and monthly GitHub Copilot estimated t
88
- **Automatic Updates**: Refreshes every 5 minutes to show the latest usage
99
- **Click to Refresh**: Click the status bar item to manually refresh the token count
1010
- **Smart Estimation**: Uses character-based analysis with model-specific ratios for token estimation
11+
- **Intelligent Caching**: Caches processed session files to speed up subsequent updates when files haven't changed
1112

1213
## Status Bar Display
1314

@@ -21,6 +22,16 @@ Hovering on the status bar item shows a detailed breakdown of token usage:
2122
Clicking the status bar item opens a detailed view with comprehensive statistics:
2223
![Detailed View](docs/images/03%20Detail%20panel.png)
2324

25+
## Performance Optimization
26+
27+
The extension uses intelligent caching to improve performance:
28+
29+
- **File Modification Tracking**: Only re-processes session files when they have been modified since the last read
30+
- **Efficient Cache Management**: Stores calculated token counts, interaction counts, and model usage data for each file
31+
- **Memory Management**: Automatically limits cache size to prevent memory issues (maximum 1000 cached files)
32+
- **Cache Statistics**: Logs cache hit/miss rates to help monitor performance improvements
33+
34+
This caching significantly reduces the time needed for periodic updates, especially when you have many chat session files.
2435

2536
## Known Issues
2637

0 commit comments

Comments
 (0)