disintegration / imaging

Imaging is a simple image processing package for Go
MIT License
5.3k stars 443 forks source link

feat: improve performance of Resize #81

Closed orisano closed 6 years ago

orisano commented 6 years ago
name                                old time/op    new time/op    delta
Resize/Down_NearestNeighbor_JPEG-4     160µs ±26%     126µs ± 4%  -21.50%  (p=0.000 n=10+10)
Resize/Down_NearestNeighbor_PNG-4      115µs ±15%     105µs ±10%     ~     (p=0.105 n=10+10)
Resize/Down_Linear_JPEG-4             2.92ms ±15%    2.17ms ±14%  -25.69%  (p=0.000 n=10+9)
Resize/Down_Linear_PNG-4              2.57ms ±25%    1.51ms ± 6%  -41.11%  (p=0.000 n=10+10)
Resize/Down_CatmullRom_JPEG-4         5.29ms ±43%    2.82ms ± 6%  -46.74%  (p=0.000 n=10+10)
Resize/Down_CatmullRom_PNG-4          3.41ms ±17%    2.36ms ± 5%  -30.70%  (p=0.000 n=9+10)
Resize/Down_Lanczos_JPEG-4            5.55ms ±18%    3.84ms ± 4%  -30.80%  (p=0.000 n=10+10)
Resize/Down_Lanczos_PNG-4             4.09ms ± 8%    3.72ms ±19%   -9.11%  (p=0.021 n=8+10)
Resize/Up_NearestNeighbor_JPEG-4      4.06ms ±25%    3.07ms ± 5%  -24.43%  (p=0.000 n=10+10)
Resize/Up_NearestNeighbor_PNG-4       2.74ms ± 4%    2.64ms ± 4%   -3.55%  (p=0.011 n=9+9)
Resize/Up_Linear_JPEG-4               19.3ms ±48%    11.5ms ±10%  -40.42%  (p=0.000 n=10+10)
Resize/Up_Linear_PNG-4                14.1ms ±29%    10.9ms ± 9%  -22.94%  (p=0.000 n=9+9)
Resize/Up_CatmullRom_JPEG-4           18.0ms ± 4%    15.6ms ± 4%  -13.51%  (p=0.000 n=10+10)
Resize/Up_CatmullRom_PNG-4            19.1ms ±20%    16.3ms ±15%  -14.86%  (p=0.000 n=9+10)
Resize/Up_Lanczos_JPEG-4              24.6ms ± 4%    23.4ms ±26%   -4.84%  (p=0.043 n=9+10)
Resize/Up_Lanczos_PNG-4               23.3ms ± 6%    23.6ms ± 9%     ~     (p=0.905 n=9+10)
disintegration commented 6 years ago

Looking at the numbers, that's an impressive improvement in performance! Thank you! I will review the changes this weekend.

disintegration commented 6 years ago

Merged. Thanks again for the contribution!