-
-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Broadcasting is much slower than necessary #400
Comments
@vchuravy I know, it's pretty annoying to ask you something about some code you wrote six years ago 🙈 RecursiveArrayTools.jl/src/array_partition.jl Line 385 in 8e727d1
Could you please explain this comment? As far as I understand right now, dropping the Current version from RecursiveArrayTools.jl
A profile shows that most time is spent in Manual version
A profile shows that most time is spent in |
Maybe this is the wrong path... With the diff
I get the same Cthulhu.jl output
as with the manual version... |
The code here probably comes from some old Distributed arrays code I was working on many years ago. Base implementation has slightly changed since there is now an output style. Would need to dig in a fair bit to understand this again. |
Describe the bug 🐞
The documentation of
ArrayPartition
statesHowever, I found that broadcasting appears to be much slower than it could be - an order of magnitude in the example below.
Expected behavior
Broadcasting is as fast as the hand-written version below.
Minimal Reproducible Example 👇
Error & Stacktrace⚠️
Environment (please complete the following information):
using Pkg; Pkg.status()
using Pkg; Pkg.status(; mode = PKGMODE_MANIFEST)
versioninfo()
Additional context
Using Cthulhu.jl, the basic difference in the underlying method
https://github.com/JuliaLang/julia/blob/306cee71560e24d26585fd1143a2aacac41b5508/base/broadcast.jl#L961-L977
seems to be the type of
bc
bc::Base.Broadcast.Broadcasted{Nothing, Nothing, typeof(*), Tuple{Float64, Vector{Float64}}}
Base.Broadcast.Broadcasted{Nothing, Tuple{Base.OneTo{Int64}}, typeof(*), Tuple{Float64, Vector{Float64}}}
For reference, the basic setup of the current broadcasting infrastructure seems to be laid in #41
The text was updated successfully, but these errors were encountered: