Cache: Use bincode instead of JSON#260
Closed
Peter554 wants to merge 10 commits intopython-grimp:mainfrom
Closed
Conversation
Because this is defined in rust, it allows us to push down more logic into Rust.
Tests are failing because the file system isn't stateful between calls across the boundary (I think because we clone the inner file system when passing it in). Is this inevitable?
There are a couple of problems with this: - It's incompatible with the old json format for some reason. - The unit tests don't work because the file system that's passed in doesn't maintain its state between the two read / write calls.
The FakeBasicFileSystem was using Box<FileSystemContents> to store its data. When get_file_system_boxed() cloned the filesystem, it created a completely separate copy of the HashMap. This meant writes to the cloned filesystem were not visible in the original, causing test failures where cached files appeared to disappear after being written. Changed FakeBasicFileSystem to use Arc<Mutex<FileSystemContents>> instead, allowing all clones to share the same underlying data with synchronized access. This ensures writes made through any clone are visible to all references. Fixes the test_write_to_cache test failure described in PR python-grimp#251. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Make sure we create any needed parent directories. This is consistent with the python FileSystem implementation.
Pretty sure these were just added for debugging.
CodSpeed Performance ReportMerging #260 will not alter performanceComparing Summary
Footnotes
|
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.
No description provided.