-
Notifications
You must be signed in to change notification settings - Fork 0
Implement tiered compression with GZip for resource packing #42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: Soar360 <15421284+Soar360@users.noreply.github.com>
Co-authored-by: Soar360 <15421284+Soar360@users.noreply.github.com>
Soar360
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // Read index entries (key and length only) | ||
| var indexEntries = new List<(string Key, int Length)>(); | ||
| // Read index entries | ||
| var indexEntries = new List<(string Key, int OriginalLength, int StoredLength, bool IsCompressed)>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
考虑封装成 struct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Changed to readonly struct IndexEntry for better type safety and performance. See commit a25f100.
| throw new KeyNotFoundException($"Resource with key '{resourceKey}' not found."); | ||
|
|
||
| // For compressed resources, we need to decompress first | ||
| if (entry.IsCompressed) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
或许,我们可以创建一个新的类型,类似 ResourceSubStream 那样,而不是直接在内存中进行解压?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea! Created ResourceDecompressionStream class (similar to ResourceSubStream) that wraps a GZipStream for on-the-fly decompression. This avoids loading entire compressed files into memory. See commit a25f100.
…ession Co-authored-by: Soar360 <15421284+Soar360@users.noreply.github.com>
|
@copilot 需要更新以下文件:
|
Co-authored-by: Soar360 <15421284+Soar360@users.noreply.github.com>
Documentation updated in commit 446d44d: README.md:
blog.md:
|
Compression Optimization Plan
IndexEntrystructResourceDecompressionStreamfor streaming decompressionDocumentation Updates
Added comprehensive documentation about the intelligent compression feature:
README.md
blog.md (Chinese)
All 42 tests passing. Documentation is comprehensive and accurate.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.