Closed
Description
openedon Jan 27, 2021
The performance of sum(Base.Broadcast.Broadcasted(*, (x, z)))
when z
has eltype Union{Float64, Missing}
regressed dramatically between Julia 1.3 and 1.4. It improved again in 1.5 but it's still much slower on master than on 1.3.
On Julia 1.3.1:
julia> using BenchmarkTools
julia> using LinearAlgebra
julia> x = rand(10_000);
julia> z = Vector{Union{Float64, Missing}}(x);
julia> f(A, w) = sum(Base.Broadcast.Broadcasted(*, (A, w)))
f (generic function with 1 method)
julia> @btime f(x, z);
31.150 μs (11 allocations: 240 bytes)
On 1.4.2:
julia> @btime f(x, z);
2.070 ms (40004 allocations: 1.07 MiB)
On master:
julia> @btime f(x, z);
941.751 μs (40002 allocations: 1.07 MiB)
Cc: @tkf. Found while investigating JuliaStats/StatsBase.jl#518 (comment).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment