Repository navigation
perf(file_memory): stop re-reading every file map on each poll (2.158.1) - #225
Merged
Merged
Conversation
list_tracked() JSON-loaded every record to read its path, and FileMemory and BranchWatch called it on timers: 64,126 records (292 MB) per call on the Yep project, 92% of them maps inside nested checkouts. It now reads only records it has not seen; BranchWatch uses is_tracked() per dirty file; the stale scan skips nested checkouts. Tests: tests/test_file_memory_fast_paths.py (4 of 6 fail on the old code).
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.
list_tracked()JSON-loaded every record in.c3/file_memoryto read itspath, and FileMemory (on any watcher change) and BranchWatch (every 30 s) called it on timers. On the Yep project that is 64,126 records (292 MB) per call, 92% of them maps of files in nested checkouts; its 14 MCP servers used about 4.5 CPU cores between them.list_tracked()now lists the store and reads only names it has not seen (a record's filename is the md5 of its path). BranchWatch checks each dirty file with the newis_tracked(), and the stale scan skips nested checkouts, which the watcher never reports. 2.158.1.Ran:
tests/test_file_memory_fast_paths.py(4 of 6 fail on the old code) and the full suite locally, 4,815 passed; 4 files fail to import here because a straytestspackage in site-packages shadows the repo's.