-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Closed
Labels
broadcastApplying a function over a collectionApplying a function over a collectionmissing dataBase.missing and related functionalityBase.missing and related functionalityperformanceMust go fasterMust go fasterregressionRegression in behavior compared to a previous versionRegression in behavior compared to a previous version
Description
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).
Metadata
Metadata
Assignees
Labels
broadcastApplying a function over a collectionApplying a function over a collectionmissing dataBase.missing and related functionalityBase.missing and related functionalityperformanceMust go fasterMust go fasterregressionRegression in behavior compared to a previous versionRegression in behavior compared to a previous version