-
-
Couldn't load subscription status.
- Fork 5.7k
Closed
Labels
performanceMust go fasterMust go fasterregressionRegression in behavior compared to a previous versionRegression in behavior compared to a previous version
Description
It looks like a potential type inference issue
using BenchmarkTools
X = rand(ComplexF32, 64, 64);
dst = reinterpret(reshape, Float32, X);
src = copy(dst);
@btime copyto!($dst, $src);
# 1.6.4: 42.120 μs (0 allocations: 0 bytes)
# 1.7.0: 800.737 μs (32768 allocations: 1.12 MiB)
# 1.8.0-DEV.1090: 829.629 μs (32768 allocations: 1.12 MiB)Profiling the code shows that it's hitting the fallback dual-iterator implementation version and a slow Tuple iterator
Lines 1041 to 1047 in d16f480
| # Dual-iterator implementation | |
| ret = iterate(iterdest) | |
| @inbounds for a in src | |
| idx, state = ret | |
| dest[idx] = a | |
| ret = iterate(iterdest, state) | |
| end |
Line 88 in d16f480
| indexed_iterate(t::Tuple, i::Int, state=1) = (@inline; (getfield(t, i), i+1)) |
Downstream JuliaImages issues: JuliaImages/Images.jl#992 JuliaImages/ImageCore.jl#174 (cc: @etibarg @timholy)
Metadata
Metadata
Assignees
Labels
performanceMust go fasterMust go fasterregressionRegression in behavior compared to a previous versionRegression in behavior compared to a previous version
