perf: fn Rav1dFrameData::{seq,frame}_hdr
: Remove .unwrap()
and Arc::deref
overhead
#751
Labels
fn Rav1dFrameData::{seq,frame}_hdr
: Remove .unwrap()
and Arc::deref
overhead
#751
I'm not a fan of these methods. They hide the cost of the
.unwrap()
andArc
derefs, which we really don't want to be doing in any tight loops like there might be infn decode_b
. Two solutions are:Most of the data accessed through things like
frame_hdr
are smallCopy
able fields. These we can justCopy
out at the beginning and use directly. For larger fields like arrays, such asgmv
, we can pay the cost there.Remove the
frame_hdr
andseq_hdr
fields fromRav1dFrameData
. If&Rav1dFrameData
can be passed all the way down, then I thinkframe_hdr
andseq_hdr
can, and then we can do the.unwrap()
andArc
deref only once at the beginning, and it very nicely untangles things.See #748 (comment).
However, this is just for perf, and the solution is not exceedingly simple, so we can save it for later.
The text was updated successfully, but these errors were encountered: