-
Notifications
You must be signed in to change notification settings - Fork 22
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
fn decomp_tx
: Do not zero txa
before initialization
#1265
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need so many ptr casts here? If it's to go from a ref to a ptr, can we use ptr::from_{ref,mut}
? They're clearer to read, as the manual ptr cast can be doing other things as well, so it's harder to read.
293dfe8
to
240c45b
Compare
3f37ee7
to
9d18014
Compare
c13ec52
to
c241b2d
Compare
9d18014
to
c71a595
Compare
c71a595
to
bd8ac77
Compare
AFAICT this is the single biggest potential perf win in rav1d. |
bd8ac77
to
2506ce8
Compare
d46f282
to
8b45876
Compare
In my testing, it looks like the latest version with less unsafe is equivalent to the unsafe pointer writes with the assert bounds check. Commenting that assert out gains a tiny bit on my i7-1260p, but seems equivalent on my Zen 4 7700X. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what that use std::ptr
in ctx.rs
is for but the lf_mask.rs
changes all LGTM now.
This adds some complexity, but it improved performance significantly, especially on intel. Zeroing an entire page of stack with
memset
(which is what was previously happening) is expensive.