My boundary element assembly code is two times slower on 0.7-beta2 than on 0.6.4. Execution hangs when I try to @profile
the relevant method. CPU usage in task manager is negligible. It this a know problem in the beta release?
That’s a pretty vague issue. Can you be a little more specific?
1 Like
Yes.
This code becomes between a factor 40 and 100 slower moving from 0.6.4 to 0.7:
using StaticArrays
u = @SVector [1.0, 0.0, 0.0]
v = @SVector [0.0, 1.0, 0.0]
function _normals(tangents, ::Type{Val{1}})
PT = eltype(tangents)
D = length(tangents)
T = eltype(PT)
n = zeros(T,D+1)
b = Array{T}(D,D)
for i in 1:D+1
fill!(b, zero(T))
for j in 1:D
for k in 1:i-1
b[k,j] = tangents[j][k]
end
for k in i:D
b[k,j] = tangents[j][k+1]
end
end
n[i] = (-1)^(i-1) * det(b)
end
n *= (-1)^D / norm(n)
normals = SVector{1,PT}([PT(n)])
metric = T[dot(tangents[i], tangents[j]) for i in 1:D, j in 1:D]
volume = sqrt(abs(det(metric))) / D
return normals, volume
end
ts = @SVector [u,v]
_normals(ts, Val{1})
@time _normals(ts, Val{1})
Have you tried fixing the deprecation warnings? If you do using StaticArrays, LinearAlgebra
and change Array{T}(D,D)
to Array{T}(undef,D,D)
it takes 20 milliseconds on my system.
2 Likes
That fixed it. Thank you.