NonlinearSolve.jl icon indicating copy to clipboard operation
NonlinearSolve.jl copied to clipboard

The precompilation of this package is likely excessive and not very useful

Open KristofferC opened this issue 1 year ago • 0 comments

This package does a more or less exhaustive combination of problems, algorithms and element types

https://github.com/SciML/NonlinearSolve.jl/blob/d434b8d48086fa799ea344694c90a997dae22d48/src/NonlinearSolve.jl#L96-L98

https://github.com/SciML/NonlinearSolve.jl/blob/d434b8d48086fa799ea344694c90a997dae22d48/src/NonlinearSolve.jl#L137-L144

A total of 104 combinations of problems and algorithms are compiled in total.

At the same time, the problem specializes on the input function:

julia> typeof(prob)
NonlinearProblem{Float64, false, Float64, NonlinearFunction{false, SciMLBase.FullSpecialize, var"#1#2",

(the var"#1#2" is an anonymous function defined locally). so the compiled code is unlikely to be valid for users (which have their own functions that they solve).

It is not clear to me that there is any point at all to the precompilation of solve(prob, alg) after the very first call has been compiled.

KristofferC avatar Apr 30 '24 10:04 KristofferC