Add cached sequence walker/reader implementation - Issue #96#495
Open
Add cached sequence walker/reader implementation - Issue #96#495
Conversation
Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: #96
Implements issue #96: Cached sequence walker or sequence reader or sequences index - **SequenceCache**: In-memory cache for sequence address-to-array mappings with thread-safe operations - **SequenceFileCache**: File-based cache with expiration support and automatic cleanup - **CachedSequenceWalker**: Main decorator that combines both caching layers with automatic invalidation - **CachedSequenceExtensions**: Extension methods for easy integration with existing ILinks implementations Key features: - Caches relationship between subsequence element arrays and their addresses - Significant performance improvements for repeated sequence reading operations - Both synchronous and asynchronous APIs - Automatic cache invalidation on data modifications - File-based persistence with configurable expiration (default 1 second) - Thread-safe concurrent operations - Cache statistics and monitoring 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>'
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.
Summary
Implements Issue #96: Cached sequence walker or sequence reader or sequences index
This PR introduces a comprehensive caching system for sequence operations that provides significant performance improvements when reading data from Links storage. The implementation caches the relationship between arrays of subsequence elements and their addresses, allowing for much faster repeated sequence reads.
🚀 Key Features
📦 New Components
SequenceCache<TLinkAddress>ConcurrentDictionarySequenceFileCache<TLinkAddress>CachedSequenceWalker<TLinkAddress>LinksDisposableDecoratorBasefollowing existing patternsUpdateandDeleteoperationsCachedSequenceExtensionsWithSequenceCache(),GetCachedSequenceArray(), etc.ILinksimplementation💡 Usage Examples
🎯 Performance Impact
The link is two subsequences, we can cache the relationship between each array of subsequence's elements and its address. So if need to convert the address to array of elements second time we can do it faster, because of cached arrays. This can have a significant impact on the speed of reading of data from Links storage.
✅ Testing
📋 Version Update
0.18.1→0.19.0(minor version for new feature)🔄 Backwards Compatibility
Test Plan
🤖 Generated with Claude Code
Resolves #96