-
Notifications
You must be signed in to change notification settings - Fork 10
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
Support writing compressed save data #83
base: master
Are you sure you want to change the base?
Conversation
We would need to update the delete-empty-file code to deal with this as well. (also, can you put the #[allow(unused_mut)] on the let mut p line instead of |
Did you have something like this in mind? It looks clean to me but I might have overengineered it |
Do we know that if we interrupt a program writing with zstd compression,
we end up with an empty file? e.g. it seems plausible that we have a
zstd header with no contents.
|
Yeah you're right. Even if the program crashes right at the end of |
Actually, why is this not a problem for uncompressed files? Shouldn't they always at least contain the header? |
I would guess it's got to do with whether/when the Encoder flushes
|
I think then we should immediately flush at the end of |
We already tend to write almost immediately after open_file. It would be
useful to figure out what exactly is going on.
|
It works but is much slower for low stems (7x). I would expect it to be asymptotically negligible. Already going from stem 100 to stem 101 takes only 61% longer.
One idea would be to have a
static ext::save::COMPRESSION_LEVEL: AtomicI32
that would control the compression level dynamically, and we could adjust it as the stems get larger.Resolves #82