Skip to content
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

Fix animation cache not working when image is behind a symlink #371

Merged
merged 1 commit into from
Oct 23, 2024

Conversation

mendess
Copy link
Contributor

@mendess mendess commented Oct 23, 2024

I noticed that for large gifs swww takes a long time to send them to the daemon. I tried seeing if I could parallelize the process somehow but instead found that the cache just wasn't working. Fixing the cache gives a lot more performance than parallelizing the compression of the frames.

Parallelizing the compression can however be done. I did a little bit of investigating and realized that, while pack_bytes has to be done sequentially. Compressing lz4 itself doesn't need to be. And after measuring the time each of those two operations take, it might be worth it.

Rough measurments in a busy machine

pack_bytes_timings: Timings { 
    min: Some(1.477043ms),
    avg: 5.156188ms,
    max: 11.548624ms,
    total: 1.057301553s,
    count: 239
}
lz4_compress_timings: Timings {
    min: Some(232.441437ms),
    avg: 290.059601ms,
    max: 321.532978ms,
    total: 68.270607189s,
    count: 239
}

@LGFae
Copy link
Owner

LGFae commented Oct 23, 2024

Parallelizing the compression can however be done.

I investigated this some time ago and decided against it since the cache already solves this problem, and I thought that parallelizing it would make it too complicated. Maybe we could try it again...

In any case, thanks for the patch!

@LGFae LGFae merged commit 5142863 into LGFae:main Oct 23, 2024
10 checks passed
@mendess mendess deleted the mendess/fix-animation-cache branch October 23, 2024 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants