You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Godbolt Link
As you can see in the asm output, even set opt-level = 3, if we don't add Copy to structs with all fields Copy derived, in clone() it generates more mov and large struct can't trigger memcpy, I suggest to add Copy to them to alleviate binary size bloated and performance problem.
List of structs that could add Copy (Simple search may miss):
Dav1dWarpedMotionParams
Dav1dSequenceHeader
Rav1dSequenceHeader
Dav1dSegmentationData
Rav1dSegmentationData
Dav1dSegmentationDataSet
Rav1dSegmentationDataSet
Dav1dLoopfilterModeRefDeltas
Rav1dLoopfilterModeRefDeltas
Rav1dFilmGrainData
Dav1dFilmGrainData
Dav1dFrameHeaderFilmGrain
Rav1dFrameHeaderFilmGrain
Dav1dFrameHeaderOperatingPoint
Dav1dFrameHeaderSuperRes
Rav1dFrameHeaderSuperRes
Dav1dFrameHeaderTiling
Rav1dFrameHeaderTiling
Dav1dFrameHeaderQuant
Rav1dFrameHeaderQuant
Dav1dFrameHeaderSegmentation
Rav1dFrameHeaderSegmentation
Dav1dFrameHeaderDeltaQ
Rav1dFrameHeaderDeltaQ
Dav1dFrameHeaderDeltaLF
Rav1dFrameHeaderDeltaLF
Dav1dFrameHeaderDelta
Rav1dFrameHeaderDelta
Dav1dFrameHeaderLoopFilter
Rav1dFrameHeaderLoopFilter
Dav1dFrameHeaderCdef
Rav1dFrameHeaderCdef
Dav1dFrameHeaderRestoration
Rav1dFrameHeaderRestoration
Dav1dFrameHeader
Rav1dFrameSize
Rav1dFrameSkipMode
Rav1dFrameHeader
Rav1dPictureParameters
AlignedPixelChunk
CdfContext
CdfMvContext
CdfMvComponent
CdfCoefContext
CdfModeContext
CdfModeInterContext
Rav1dTileGroupHeader
Av1BlockIntra
Av1BlockInter1d
Av1BlockInter2d
Av1BlockInterNd
Av1BlockInter
The text was updated successfully, but these errors were encountered:
I didn't realize this happens. Very good catch! We'll definitely look into this. It's a shame rustc optimizes non-Copy types so much worse, though, even when they're otherwise identical.
Godbolt Link
As you can see in the asm output, even set
opt-level = 3
, if we don't addCopy
to structs with all fieldsCopy
derived, inclone()
it generates moremov
and large struct can't triggermemcpy
, I suggest to addCopy
to them to alleviate binary size bloated and performance problem.List of structs that could add
Copy
(Simple search may miss):The text was updated successfully, but these errors were encountered: