Repository navigation
Conversation
RunDevelopment
left a comment
Member
There was a problem hiding this comment.
Thanks for the PR.
I'm not against this, but I vaguely remember maintainers being wary of adding more monomorphized code to color conversions to keep compile times and code size down. You might want to ask your favorite clanker to go through old PRs and issues to get the specifics.
Also, there's definitely still room for improvement regarding performance. I left a few comments if you want to make it even faster.
And don't worry about CI failing.
Author
|
Thank you. I applied the changes. |
Author
|
@RunDevelopment I applied the changes from your review. Can you look at it again? |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For 8 layout pairs,
CicpRgb::cast_pixels_by_fallbacknow converts each pixel in one pass, without the f32 scratch buffers. The pairs are RGB(A) to Luma(A) and Luma(A) to RGB(A). The operations and their order are the same, so output from integer input does not change. Some float values change by 1 ulp, and a NaN alpha in Rgba32F to LumaA8 or LumaA16 now gives the maximum value, not 0. These values are now the same as the values fromto_luma32fandto_rgba8.Compared to the first commit, RGBA32F → LumaA16 is 9% slower because of the NaN check in
from_primitive. It is 32% faster than before this PR. I measured no other slowdown on 55 benchmarks. I used 12 interleaved rounds of criterion and a Mann-Whitney test (Apple Silicon, rustc 1.98). I did not measure other architectures.Checks:
cargo testpasses with default features, with--no-default-features, and on 1.88 (MSRV).cargo clippy --all-targets -- -D warningsandcargo fmt --checkpass.This PR is substantially LLM-generated.