MultivariateStats.jl icon indicating copy to clipboard operation
MultivariateStats.jl copied to clipboard

Improve performance of fastica

Open baggepinnen opened this issue 3 years ago • 1 comments

This PR produces the following timings for my (2, 485156) testinput

565.305 ms (344 allocations: 37.05 MiB) # baseline
300.948 ms (211 allocations: 37.04 MiB) # inbounds
259.164 ms (192 allocations: 37.03 MiB) # @simd

baggepinnen avatar Jul 06 '20 09:07 baggepinnen

I noticed that my benchmarks were misleading due to the stochastic initialization of W. With deterministic init, the improvements are much more modest, but this PR might still be worthwhile since it fixes some type problems as well.

# do_whiten = true
334.604 ms (226 allocations: 22.23 MiB) # Baseline
325.827 ms (226 allocations: 22.23 MiB) # inbounds

# do_whiten = false
33.877 ms (44 allocations: 14.81 MiB) # baseline
32.711 ms (44 allocations: 14.81 MiB) # inbounds

baggepinnen avatar Jul 06 '20 11:07 baggepinnen