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

feat(catwalk): use ril with pure rust webp feature #147

Closed
wants to merge 5 commits into from

Conversation

nekowinston
Copy link
Contributor

Closes catppuccin/catwalk#5, moving all the dependencies to native Rust instead of binding to libwebp-sys.

@backwardspy
Copy link
Member

was just testing this out and noticed it's quite a lot faster than catwalk on main:

Benchmark 1: ./catwalk-main
  Time (mean ± σ):      1.216 s ±  0.010 s    [User: 1.180 s, System: 0.034 s]
  Range (min … max):    1.193 s …  1.231 s    10 runs

Benchmark 2: ./catwalk-winston
  Time (mean ± σ):     405.3 ms ±   5.7 ms    [User: 370.4 ms, System: 34.9 ms]
  Range (min … max):   396.7 ms … 418.2 ms    10 runs

Summary
  ./catwalk-winston ran
    3.00 ± 0.05 times faster than ./catwalk-main

nice!

@nekowinston
Copy link
Contributor Author

I'd like to update this PR with my latest changes on my ril PR, but I don't have write permissions to this branch anymore.

@nekowinston nekowinston changed the title feat(webp): use ril with rust-native image-webp feature feat(catwalk): use ril with pure rust webp feature Apr 10, 2024
@unseen-ninja
Copy link
Member

I've added you as a Maintainer. c:

@nekowinston
Copy link
Contributor Author

nekowinston commented Apr 10, 2024

@backwardspy

was just testing this out and noticed it's quite a lot faster than catwalk on main:

I can pretty much replicate these results 1:1 on my own x86_64 hardware, but it seems like the compression factor is worse?

image

Here I'm using the PR version of catwalk to generate preview.webp in the VSCode port, preview-before.webp is the current version, and then I reencode it with ImageMagick's convert. The hexyl commands are just to verify that they're all VP8L, so correctly being saved as lossless.
The ImageMagick version has the smallest resulting size, catwalk with this PR encodes images in a way that's usually 2-3x larger than the main branch. 🤔

@nekowinston nekowinston marked this pull request as draft April 10, 2024 23:47
@backwardspy
Copy link
Member

that is interesting, i didn't think to check file size.

i get similar results with imagemagick coming out on top:

296K    preview-magick.webp
304K    preview-cwebp.webp
304K    preview-main.webp
628K    preview-feat-ril-webp.webp

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.

Update to Rust native webp implementation
3 participants