Closed piever closed 3 years ago
Bump?
This looks ok to me at a first glance but I haven't had time for a detailed review, sorry. Will try to do it soon.
Sorry to bump this again, but it seems that it is important to get this in to move forward with changes in Makie. We are adding support to statistical plots in AbstractPlotting.jl (see https://github.com/JuliaPlots/AbstractPlotting.jl/pull/478), and it looks like this PR mitigates the increase in load time substantially.
Here are times to load (after a first run to precompile) on julia 1.5
# AbstractPlotting master
julia> @time using AbstractPlotting
6.322670 seconds (9.76 M allocations: 600.265 MiB, 1.30% gc time)
# AbstractPlotting with pv/stats PR and KernelDensity release
julia> @time using AbstractPlotting
13.004530 seconds (19.41 M allocations: 1.097 GiB, 3.11% gc time)
# AbstractPlotting with pv/stats PR and this PR on KernelDensity
julia> @time using AbstractPlotting
10.147386 seconds (15.28 M allocations: 905.327 MiB, 2.54% gc time)
(Removing Optim seems like the only easy way to speed things up, because it is not used by most other statistical packages, whereas most other deps are shared and would be much harder to remove.)
Sorry for not reviewing earlier, I appreciate the ping. I requested some minor changes, and will merge ASAP when this converges.
Thank you for the review! I've addressed the feedback.
I requested some minor changes, and will merge ASAP when this converges.
Great! Could it be possible to also have a release after this is merged?
Fix #83. This adds a simple implementation of the golden section algorithm, so that KernelDensity can drop the Optim dependency. The issue (at least for me) is that Optim is somewhat heavy (3 seconds of load time), and KernelDensity is needed as a dependency for plotting packages for 1D and 2D density plots, so ideally it should be a bit more lightweight.
Removing Optim shaves off a couple of seconds from load time.
On master:
With this PR: