-
Notifications
You must be signed in to change notification settings - Fork 0
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
chore: replace oxipng with crates.io version once it's published #1
Labels
bug
Something isn't working
Comments
wait-what
added
enhancement
New feature or request
help wanted
Extra attention is needed
labels
Jun 16, 2023
Using this code as an example. My CPU has 12 threads. This works perfectly well with 11, but as soon as I uncomment 12, none of them finish, there is no CPU activity and the program just hangs. On an 8 thread CPU, it works with 7, but hangs with 8, etc. use rayon::prelude::*;
use oxipng::{optimize_from_memory, Options, Deflaters};
fn main() {
let buffer = include_bytes!("sample.png").as_slice();
let options = Options {
deflate: Deflaters::Libdeflater { compression: 12 },
..Default::default()
};
vec![
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
// 12,
].par_iter().for_each(|x| {
println!("Optimizing {x}");
optimize_from_memory(&buffer, &options).unwrap();
println!("Done {x}");
});
} |
Seems to be an upstream issue shssoichiro/oxipng#517 |
wait-what
changed the title
Parallelise oxipng
chore: bump oxipng version once deadlock fix is merged
Jun 21, 2023
wait-what
added
bug
Something isn't working
and removed
help wanted
Extra attention is needed
enhancement
New feature or request
labels
Jun 21, 2023
wait-what
changed the title
chore: bump oxipng version once deadlock fix is merged
chore: replace oxipng with crates.io version once it's published
Jun 27, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
src/encode
Putting it inside a rayonpar_iter
makes it hang, presumably because it already uses rayon. Since oxipng is really, really slow, it's important to make it multithreaded.Once fixed, also update docs/input-manifest.md
The text was updated successfully, but these errors were encountered: