-
Notifications
You must be signed in to change notification settings - Fork 416
Skip pre-compression of small text files in savestate archives #4417
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
@YoshiRulz 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs. I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review. |
Line 328 in a630b72
|
Co-authored-by: YoshiRulz <[email protected]>
Yes, it's a bit hypocritical for me to spearhead both the ban and adoption of Copilot, but I would at least like to be told which file(s) to edit. I believe Copilot is now good enough to do that assuming I do what it asks and set up a config file. |
Co-authored-by: YoshiRulz <[email protected]>
@copilot rebase |
Crucially, having it self-identify on every change, and leave comments. I'll look into other agents later; there's no standard for how to configure them like there is for IDEs, but on the bright side the config is all natural language so a symlink to this file would probably work.
Pushed 5cbc1de. |
1, I fundementally reject using AI tools here at all, and frankly if you want to be undoing this policy, you should be opening a discussion on it. |
|
This PR addresses a performance regression where small text files in savestate archives were being compressed with zstd, causing them to become larger due to compression overhead.
Problem
After commit 5d891e0, all text files in savestate archives started being compressed by default. However, small text files (like version strings, short JSON configurations) actually become larger when compressed due to the overhead of the compression format headers and metadata.
Solution
Modified
ZipStateSaver.PutLump(BinaryStateLump lump, Action<TextWriter> callback)
to conditionally compress text files based on their size:The implementation:
StringWriter
first to measure the UTF-8 byte sizeValidation
Empirical testing shows:
Impact
Example files affected:
BizVersion
entries (version strings)SyncSettings
JSON configurationsUserData
entriesInput
logs andLagLog
entries still get compressedFixes #4415.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/TASEmulators/BizHawk/commits/5d891e0683928ea341c742f54cf40e54e04f1bd8/comments
curl -s REDACTED
(http block)If you need me to access, download, or install something from one of these locations, you can either:
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.