- Notifications
You must be signed in to change notification settings - Fork673
Remove some allocations from HDR Decoder#1965
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
fintelia commentedJul 19, 2023
I've only skimmed it, but this PR looks kinda hard to review because moves around a bunch of finicky code. One thing that particularly stands out to me though is that it uses a macro to generate generic, unsafe trait impls, on a public type. That's both a public API addition and inserts new unsafe code to the library. Potentially hard to justify for a minor perf improvement |
JulianKnodt commentedJul 19, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
One alternative is to create a clone of the Other than exposing an |
fintelia commentedJul 19, 2023
Looking though this now, the PR basically just changes a memcpy into an unsafe transmute? That's not an improvement IMO. We'd ideally like this crate to be |
JulianKnodt commentedJul 19, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
For me, as long as the unsafe code is entirely within the confines of the API and with controlled types, then it's fine to introduce. But that's a personal opinion, so I've ripped it out & should be cleaner now. |
7f9b197 to94847faCompare
A larger change was proposed in#1599,
but this is intended tofix#1882 precisely.
It adds extra trait implementations to
Pixels, and removes the allocation while keeping the API the same.