JuliaImages / ImageFiltering.jl

Julia implementations of multidimensional array convolution and nonlinear stencil operations
Other
99 stars 49 forks source link

Add some precompiles #201

Closed timholy closed 3 years ago

timholy commented 3 years ago

On the current release, the first call looks like this:

julia> @time imfilter(img, KernelFactors.gaussian((3,3)));
  2.135609 seconds (3.46 M allocations: 211.109 MiB, 12.01% gc time, 94.98% compilation time)

julia> @time mapwindow(extrema, img, (3,3))
  0.756083 seconds (1.17 M allocations: 68.258 MiB, 6.57% gc time, 99.89% compilation time)

On this branch, it looks like this:

julia> @time imfilter(img, KernelFactors.gaussian((3,3)));
  0.620004 seconds (362.78 k allocations: 40.455 MiB, 1.47% gc time, 96.09% compilation time)

julia> @time mapwindow(extrema, img, (3,3))
  0.385470 seconds (334.52 k allocations: 19.585 MiB, 9.43% gc time, 99.82% compilation time)

Quite a nice reduction in latency.

I should note this requires https://github.com/JuliaMath/AbstractFFTs.jl/pull/48 and also some changes to FFTW.jl that I haven't yet submitted since they rely on the changes in AbstractFFTs.

codecov[bot] commented 3 years ago

Codecov Report

Merging #201 (4ca2542) into master (83ac3ed) will decrease coverage by 0.58%. The diff coverage is 95.83%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #201      +/-   ##
==========================================
- Coverage   91.59%   91.00%   -0.59%     
==========================================
  Files           9       10       +1     
  Lines        1380     1412      +32     
==========================================
+ Hits         1264     1285      +21     
- Misses        116      127      +11     
Impacted Files Coverage Δ
src/ImageFiltering.jl 77.27% <ø> (ø)
src/kernelfactors.jl 91.15% <90.00%> (-2.42%) :arrow_down:
src/precompile.jl 94.11% <94.11%> (ø)
src/border.jl 93.02% <100.00%> (-1.13%) :arrow_down:
src/kernel.jl 98.40% <100.00%> (-1.60%) :arrow_down:
src/mapwindow.jl 86.22% <100.00%> (-0.45%) :arrow_down:
src/utils.jl 87.30% <0.00%> (-1.59%) :arrow_down:
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 83ac3ed...4ca2542. Read the comment docs.

timholy commented 3 years ago

I think we can merge this as-is, and continue in separate efforts.