-
Notifications
You must be signed in to change notification settings - Fork 3
Closed
Description
# From: https://timholy.github.io/SnoopCompile.jl/stable/snoopr/
using SnoopCompile
invalidations = @snoopr begin
using DifferentialEquations
function lorenz(du,u,p,t)
du[1] = 10.0(u[2]-u[1])
du[2] = u[1]*(28.0-u[3]) - u[2]
du[3] = u[1]*u[2] - (8/3)*u[3]
end
u0 = [1.0;0.0;0.0]
tspan = (0.0,100.0)
prob = ODEProblem(lorenz,u0,tspan)
alg = Rodas5()
tinf = solve(prob,alg)
end;
trees = SnoopCompile.invalidation_trees(invalidations);
@show length(SnoopCompile.uinvalidated(invalidations)) # show total invalidations
show(trees[end]) # show the most invalidated method
# Count number of children (number of invalidations per invalidated method)
n_invalidations = map(trees) do methinvs
SnoopCompile.countchildren(methinvs)
end
Flagged this repo with being high on the invalidations list.
julia> trees[end-3]
inserting reduce_empty(rf::InitialValues.AdjoinIdentity, ::Type{T}) where T in InitialValues at C:\Users\accou\.julia\packages\InitialValues\P5PLf\src\InitialValues.jl:316 invalidated:
backedges: 1: superseding reduce_empty(op, ::Type{T}) where T in Base at reduce.jl:311 with MethodInstance for Base.reduce_empty(::Function, ::Type{Expr}) (2 children)
2: superseding reduce_empty(op, ::Type{T}) where T in Base at reduce.jl:311 with MethodInstance for Base.reduce_empty(::Function, ::Type{Pkg.Resolve.FieldValue}) (21 children)
3: superseding reduce_empty(op, ::Type{T}) where T in Base at reduce.jl:311 with MethodInstance for Base.reduce_empty(::Function, ::Type{VersionNumber}) (21 children)
4: superseding reduce_empty(op, ::Type{T}) where T in Base at reduce.jl:311 with MethodInstance for Base.reduce_empty(::Function, ::Type{Int64}) (107 children)
6 mt_cache
Can that overload be removed?
Metadata
Metadata
Assignees
Labels
No labels