Skip to content

Commit 6c066c8

Browse files
authored
Improve broadcasting performance by defining dataids (#89)
1 parent 69e4a03 commit 6c066c8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/OffsetArrays.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@ end
161161
val
162162
end
163163

164+
# For fast broadcasting: ref https://discourse.julialang.org/t/why-is-there-a-performance-hit-on-broadcasting-with-offsetarrays/32194
165+
Base.dataids(A::OffsetArray) = Base.dataids(parent(A))
166+
164167
### Special handling for AbstractRange
165168

166169
const OffsetRange{T} = OffsetArray{T,1,<:AbstractRange{T}}

0 commit comments

Comments
 (0)