Closed
Description
At SciML/OrdinaryDiffEq.jl#571 an instance of very slow broadcast was identified:
using BenchmarkTools, StaticArrays
f(ũ, u₀, u₁, ρ) = ũ ./ (1e-6 .+ max.(abs.(u₀), abs.(u₁)) .* ρ)
ũ, u₀, u₁, ρ = rand(3), rand(3), rand(3), rand(3)
@btime f($ũ, $u₀, $u₁, $ρ) # 47.473 ns (1 allocation: 112 bytes)
ũ, u₀, u₁, ρ = rand(SVector{3}), rand(SVector{3}), rand(SVector{3}), rand(SVector{3})
@btime f($ũ, $u₀, $u₁, $ρ) # 2.354 μs (44 allocations: 3.59 KiB)