Got it
julia> outer_product2(vs) = .*([reshape(vs[d], (ntuple(Returns(1), d-1)..., :)) for d in 1:length(vs)]... )
julia> @benchmark outer_product($vs)
BenchmarkTools.Trial: 10000 samples with 5 evaluations.
Range (min β¦ max): 6.045 ΞΌs β¦ 1.440 ms β GC (min β¦ max): 0.00% β¦ 98.98%
Time (median): 6.857 ΞΌs β GC (median): 0.00%
Time (mean Β± Ο): 7.907 ΞΌs Β± 31.443 ΞΌs β GC (mean Β± Ο): 8.84% Β± 2.21%
β
βββββ
βββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββ β
6.04 ΞΌs Histogram: frequency by time 15.6 ΞΌs <
Memory estimate: 5.11 KiB, allocs estimate: 135.
julia> @benchmark outer_product2($vs)
BenchmarkTools.Trial: 10000 samples with 10 evaluations.
Range (min β¦ max): 1.632 ΞΌs β¦ 591.462 ΞΌs β GC (min β¦ max): 0.00% β¦ 99.03%
Time (median): 1.880 ΞΌs β GC (median): 0.00%
Time (mean Β± Ο): 2.032 ΞΌs Β± 5.930 ΞΌs β GC (mean Β± Ο): 2.88% Β± 0.99%
ββββ ββ β ββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
1.63 ΞΌs Histogram: frequency by time 2.82 ΞΌs <
Memory estimate: 752 bytes, allocs estimate: 15.
thanks