-
-
Notifications
You must be signed in to change notification settings - Fork 890
Closed
Description
Prerequisites
- I have written a descriptive issue title
- I have verified that I am running the latest version of ImageSharp
- I have searched open and closed issues to ensure it has not already been reported
Description
This issue has been opened to track and discuss perf improvements that could be made to ResizeProcessor:
- Use
PinnedBuffer<Vector4>forfirstPassPixelsand utilize bulk conversion - Apply microoptimizations to
ResamplingWeightedProcessor<TColor>.Weightsto make it more cache friendly
Investigate possibilities to reduce the size of resampler windows without loss of quality.
- Operate on a transposed variant of firstPassPixels to utilize
BulkPixelOperations<TColor>.PackFromVector4(). - Drop repetitive weight values in
WeightsBuffer - Use Value Type Kernels as Weights windows
- Investigate possibilities for faster Compress and Expand execution to speedup the Compand variant.
Update
After analyzing the precomputed weights data, I found out the windows are much smaller than I thought (I misread the code first time), so we can not reduce the window size.
However:
- This is how the
WeightsBufferlooks like with a Bicubic 500->200 resize operation. 90% of the data is repetitive. We can allocate + precalculate less! - The size of
IResampler.Radiusis known at compile time for each reasmpler. It means we can achieve significant improvements by utilizing Value Type Kernels. (See Proposal: Value Type Kernels #142)
Reactions are currently unavailable