Command-line options --trace-compile
and, on nightly, --trace-compile-timing
exist to find that out.
First thing I did was get rid of the global variables in your example, to make the example relevant (file /tmp/j.jl
):
using OrdinaryDiffEq, Optim
function f(du, u, p, t)
du[1] = dx = p[1] * u[1] - u[1] * u[2]
du[2] = dy = -3 * u[2] + u[1] * u[2]
end
const prob = let
u0 = [1.0; 1.0]
tspan = (0.0, 10.0)
p = [1.5]
ODEProblem(f, u0, tspan, p)
end
function loss_func(p)
remade_prob = remake(prob, p=p);
sol = try
solve(remade_prob);
catch e
return Inf # ODE simulation diverges
end
return (sol.u[end][1] - 2) ^ 2 # arbitrary loss function
end
optimize(loss_func, [0.1], [10.], [1.], Fminbox(BFGS()); autodiff = :forward)
alias(p) = loss_func(p)
optimize(alias, [0.1], [10.], [1.], Fminbox(BFGS()); autodiff = :forward)
Then I ran Julia like so:
julia -t9 --trace-compile=/tmp/compile.jl --trace-compile-timing /tmp/j.jl
The relevant lines, mentioning alias
, are:
#= 20.5 ms =# precompile(Tuple{Type{NLSolversBase.OnceDifferentiable{TF, TDF, TX} where TX where TDF where TF}, typeof(Main.alias), Array{Float64, 1}, Float64, Array{Float64, 1}, Symbol, ForwardDiff.Chunk{1}})
#= 4.4 ms =# precompile(Tuple{Type{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, V, N} where N where V}, Float64, ForwardDiff.Partials{1, Float64}})
#= 4.3 ms =# precompile(Tuple{Type{ForwardDiff.Partials{1, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}}, Tuple{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}})
#= 4.7 ms =# precompile(Tuple{Type{Base.Generator{I, F} where F where I}, FunctionWrappers.var"#14#15"{Type{Tuple{Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, Float64}}}, Base.UnitRange{Int64}})
#= 11.1 ms =# precompile(Tuple{typeof(Base.iterate), Base.Generator{Base.UnitRange{Int64}, FunctionWrappers.var"#14#15"{Type{Tuple{Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, Float64}}}}})
#= 6.1 ms =# precompile(Tuple{typeof(Base.iterate), Base.Generator{Base.UnitRange{Int64}, FunctionWrappers.var"#14#15"{Type{Tuple{Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, Float64}}}}, Int64})
#= 4.6 ms =# precompile(Tuple{Type{Base.Generator{I, F} where F where I}, FunctionWrappers.var"#14#15"{Type{Tuple{Array{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, Float64}}}, Base.UnitRange{Int64}})
#= 11.0 ms =# precompile(Tuple{typeof(Base.iterate), Base.Generator{Base.UnitRange{Int64}, FunctionWrappers.var"#14#15"{Type{Tuple{Array{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, Float64}}}}})
#= 6.1 ms =# precompile(Tuple{typeof(Base.iterate), Base.Generator{Base.UnitRange{Int64}, FunctionWrappers.var"#14#15"{Type{Tuple{Array{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, Float64}}}}, Int64})
#= 4.6 ms =# precompile(Tuple{Type{Base.Generator{I, F} where F where I}, FunctionWrappers.var"#14#15"{Type{Tuple{Array{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}}}}, Base.UnitRange{Int64}})
#= 11.0 ms =# precompile(Tuple{typeof(Base.iterate), Base.Generator{Base.UnitRange{Int64}, FunctionWrappers.var"#14#15"{Type{Tuple{Array{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}}}}}})
#= 6.0 ms =# precompile(Tuple{typeof(Base.iterate), Base.Generator{Base.UnitRange{Int64}, FunctionWrappers.var"#14#15"{Type{Tuple{Array{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}}}}}, Int64})
#= 4.6 ms =# precompile(Tuple{Type{Base.Generator{I, F} where F where I}, FunctionWrappers.var"#14#15"{Type{Tuple{Array{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}}}}, Base.UnitRange{Int64}})
#= 11.0 ms =# precompile(Tuple{typeof(Base.iterate), Base.Generator{Base.UnitRange{Int64}, FunctionWrappers.var"#14#15"{Type{Tuple{Array{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}}}}}})
#= 6.0 ms =# precompile(Tuple{typeof(Base.iterate), Base.Generator{Base.UnitRange{Int64}, FunctionWrappers.var"#14#15"{Type{Tuple{Array{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}}}}}, Int64})
#= 3.8 ms =# precompile(Tuple{Type{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}})
#= 4.8 ms =# precompile(Tuple{typeof(Base.:(*)), ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, Base.Rational{Int64}})
#= 3.6 ms =# precompile(Tuple{typeof(Base.convert), Type{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}})
#= 3.6 ms =# precompile(Tuple{typeof(Base.real), ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}})
#= 4.1 ms =# precompile(Tuple{typeof(ForwardDiff.value), ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}})
#= 4.9 ms =# precompile(Tuple{typeof(Base.convert), Type{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, Bool})
#= 4.6 ms =# precompile(Tuple{typeof(Base.:(+)), ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}})
#= 4.8 ms =# precompile(Tuple{typeof(Base.:(/)), ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}})
#= 4.6 ms =# precompile(Tuple{typeof(Base.:(*)), ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}})
#= 4.4 ms =# precompile(Tuple{typeof(Base.:(-)), ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}})
#= 5.2 ms =# precompile(Tuple{typeof(Base.sqrt), ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}})
#= 4.4 ms =# precompile(Tuple{Type{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, Float64})
#= 4.8 ms =# precompile(Tuple{typeof(Base.:(*)), Float64, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}})
#= 4.8 ms =# precompile(Tuple{typeof(Base.inv), ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}})
#= 5.2 ms =# precompile(Tuple{typeof(LinearAlgebra.norm), ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}})
#= 3.8 ms =# precompile(Tuple{typeof(Base.float), ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}})
#= 5.3 ms =# precompile(Tuple{typeof(Base.abs), ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}})
#= 5.0 ms =# precompile(Tuple{typeof(Base.abs2), ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}})
#= 4.6 ms =# precompile(Tuple{typeof(Base.convert), Type{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, Int64})
#= 5.1 ms =# precompile(Tuple{typeof(LinearAlgebra.dot), ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}})
#= 4.6 ms =# precompile(Tuple{typeof(Base.Broadcast.broadcasted), typeof(Base.identity), ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}})
#= 7.9 ms =# precompile(Tuple{typeof(Base.getproperty), Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{0}, Nothing, typeof(Base.identity), Tuple{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}}, Symbol})
#= 3.7 ms =# precompile(Tuple{typeof(Base.getindex), ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}})
#= 4.9 ms =# precompile(Tuple{typeof(Base.:(-)), ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}})
#= 14.3 ms =# precompile(Tuple{typeof(Polyester.add_var!), Expr, Expr, Expr, Type{Base.SubArray{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 2, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 2}, Tuple{Base.Slice{Base.OneTo{Int64}}, Base.UnitRange{Int64}}, true}}, Symbol, Symbol, Int64})
#= 4.7 ms =# precompile(Tuple{Type{Polyester.BatchClosure{RecursiveFactorization.var"#apply_permutation!##0#apply_permutation!##1", ManualMemory.Reference{Tuple{Static.StaticInt{1}, Static.StaticInt{1}, Polyester.NoLoop, Polyester.CombineIndices, StrideArraysCore.AbstractPtrArray{Int64, 1, (1,), Tuple{Int64}, Tuple{Nothing}, Tuple{Static.StaticInt{1}}, Int64}, StrideArraysCore.AbstractPtrArray{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 2, (1, 2), Tuple{Int64, Int64}, Tuple{Nothing, Nothing}, Tuple{Static.StaticInt{1}, Static.StaticInt{1}}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}}}, false, Tuple{}}}, Function})
#= 4.2 ms =# precompile(Tuple{typeof(Base.getproperty), Polyester.BatchClosure{RecursiveFactorization.var"#apply_permutation!##0#apply_permutation!##1", ManualMemory.Reference{Tuple{Static.StaticInt{1}, Static.StaticInt{1}, Polyester.NoLoop, Polyester.CombineIndices, StrideArraysCore.AbstractPtrArray{Int64, 1, (1,), Tuple{Int64}, Tuple{Nothing}, Tuple{Static.StaticInt{1}}, Int64}, StrideArraysCore.AbstractPtrArray{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 2, (1, 2), Tuple{Int64, Int64}, Tuple{Nothing, Nothing}, Tuple{Static.StaticInt{1}, Static.StaticInt{1}}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}}}, false, Tuple{}}, Symbol})
#= 14.2 ms =# precompile(Tuple{typeof(Polyester.add_var!), Expr, Expr, Expr, Type{Base.SubArray{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 2, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 2}, Tuple{Base.UnitRange{Int64}, Base.UnitRange{Int64}}, false}}, Symbol, Symbol, Int64})
#= 4.7 ms =# precompile(Tuple{Type{Polyester.BatchClosure{RecursiveFactorization.var"#apply_permutation!##0#apply_permutation!##1", ManualMemory.Reference{Tuple{Static.StaticInt{1}, Static.StaticInt{1}, Polyester.NoLoop, Polyester.CombineIndices, StrideArraysCore.AbstractPtrArray{Int64, 1, (1,), Tuple{Int64}, Tuple{Nothing}, Tuple{Static.StaticInt{1}}, Int64}, StrideArraysCore.AbstractPtrArray{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 2, (1, 2), Tuple{Int64, Int64}, Tuple{Nothing, StrideArraysCore.StrideReset{Int64}}, Tuple{Static.StaticInt{1}, Static.StaticInt{1}}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}}}, false, Tuple{}}}, Function})
#= 4.1 ms =# precompile(Tuple{typeof(Base.getproperty), Polyester.BatchClosure{RecursiveFactorization.var"#apply_permutation!##0#apply_permutation!##1", ManualMemory.Reference{Tuple{Static.StaticInt{1}, Static.StaticInt{1}, Polyester.NoLoop, Polyester.CombineIndices, StrideArraysCore.AbstractPtrArray{Int64, 1, (1,), Tuple{Int64}, Tuple{Nothing}, Tuple{Static.StaticInt{1}}, Int64}, StrideArraysCore.AbstractPtrArray{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 2, (1, 2), Tuple{Int64, Int64}, Tuple{Nothing, StrideArraysCore.StrideReset{Int64}}, Tuple{Static.StaticInt{1}, Static.StaticInt{1}}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}}}, false, Tuple{}}, Symbol})
#= 7685.3 ms =# precompile(Tuple{NLSolversBase.var"#OnceDifferentiable##4#OnceDifferentiable##5"{Float64, typeof(Main.alias), ForwardDiff.GradientConfig{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}}}, Array{Float64, 1}, Array{Float64, 1}})
#= 36.2 ms =# precompile(Tuple{typeof(OrdinaryDiffEqCore.alg_cache), OrdinaryDiffEqTsit5.Tsit5{typeof(OrdinaryDiffEqCore.trivial_limiter!), typeof(OrdinaryDiffEqCore.trivial_limiter!), Static.False}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, Type{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, Type{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, Type{Float64}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, SciMLBase.ODEFunction{true, SciMLBase.AutoSpecialize, FunctionWrappersWrappers.FunctionWrappersWrapper{Tuple{FunctionWrappers.FunctionWrapper{Nothing, Tuple{Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, Float64}}, FunctionWrappers.FunctionWrapper{Nothing, Tuple{Array{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, Float64}}, FunctionWrappers.FunctionWrapper{Nothing, Tuple{Array{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}}}, FunctionWrappers.FunctionWrapper{Nothing, Tuple{Array{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}}}}, false}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing, Nothing, Nothing}, Float64, Float64, Float64, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, Bool, Base.Val{true}})
#= 6.6 ms =# precompile(Tuple{FunctionWrappers.CallWrapper{Nothing}, SciMLBase.Void{FunctionWrappersWrappers.FunctionWrappersWrapper{Tuple{FunctionWrappers.FunctionWrapper{Nothing, Tuple{Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, Float64}}, FunctionWrappers.FunctionWrapper{Nothing, Tuple{Array{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, Float64}}, FunctionWrappers.FunctionWrapper{Nothing, Tuple{Array{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}}}, FunctionWrappers.FunctionWrapper{Nothing, Tuple{Array{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}}}}, false}}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, Float64})
#= 13.2 ms =# precompile(Tuple{FunctionWrappers.CallWrapper{Nothing}, SciMLBase.Void{typeof(Main.f)}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, Float64})
#= 142.7 ms =# precompile(Tuple{typeof(OrdinaryDiffEqCore.alg_cache), OrdinaryDiffEqRosenbrock.Rosenbrock23{0, ADTypes.AutoFiniteDiff{Base.Val{:forward}, Base.Val{:forward}, Base.Val{:hcentral}}, Nothing, typeof(OrdinaryDiffEqCore.DEFAULT_PRECS), Base.Val{:forward}(), true, nothing, typeof(OrdinaryDiffEqCore.trivial_limiter!), typeof(OrdinaryDiffEqCore.trivial_limiter!)}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, Type{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, Type{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, Type{Float64}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, SciMLBase.ODEFunction{true, SciMLBase.AutoSpecialize, FunctionWrappersWrappers.FunctionWrappersWrapper{Tuple{FunctionWrappers.FunctionWrapper{Nothing, Tuple{Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, Float64}}, FunctionWrappers.FunctionWrapper{Nothing, Tuple{Array{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, Float64}}, FunctionWrappers.FunctionWrapper{Nothing, Tuple{Array{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}}}, FunctionWrappers.FunctionWrapper{Nothing, Tuple{Array{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, 1}, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}}}}, false}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing, Nothing, Nothing}, Float64, Float64, Float64, Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.alias), Float64}, Float64, 1}, 1}, Bool, Base.Val{true}})
#= 4.5 ms =# precompile(Tuple{typeof(Main.alias), Array{Float64, 1}})
The compilation of one method, belonging to an anonymous function from NLSolversBase.jl, took most of the time.
I think that’s as far as I can investigate without getting into the internals of specific packages.