SciML / NonlinearSolve.jl

High-performance and differentiation-enabled nonlinear solvers (Newton methods), bracketed rootfinding (bisection, Falsi), with sparsity and Newton-Krylov support.
https://docs.sciml.ai/NonlinearSolve/stable/
MIT License
238 stars 42 forks source link

Precompile Time explodes with v2.0.0 #223

Closed waldie11 closed 1 year ago

waldie11 commented 1 year ago

I am using NonlinearSolve as a dependency from OrdinaryDiffEq.jl Iam used to see OrdinaryDiffEq being a heavy dependency in the precompile phase. Pulling in NonlinearSolve on v2.0.0 is however skyrocketing precompile time - increasing also precompile time for packages depending on it.

Starting from this setup from a plain .julia environment, precompile is finished within 4min on my machine. After dropping the restriction on <2.0.0 Iam giving up after 5min only seeing NonlinearSolve and not even starting with OrdinaryDiffEq. I have seen it finish already, but I didnt time it then (and am not going to do it again) and think its in the region of 30min.

name = "short_test"
uuid = "ac54827c-5042-4dc0-8a8e-9aaad1679992"

[deps]
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"

[compat]
NonlinearSolve = "<2.0.0"

[weakdeps]
NonlinearSolve = "8913a72c-1f9b-4ce2-8d82-65094dcecaec"
  [8913a72c] ↑ NonlinearSolve v1.10.1 ⇒ v2.0.0
Precompiling project...
  Progress [>                                        ]  0/3
  ◓ NonlinearSolve
ErikQQY commented 1 year ago

Same here, I tested on a server, plain environment, precompiled BoundaryValueDiffEq version 5.0.0(which uses NonlinearSolve version 2.0.0), took about 20 mins to only finish the NonlinearSolve precompiling

simonbyrne commented 1 year ago

On my machine (Julia 1.9.3 on an M2 mac), precompilation of NonlinearSolve.jl goes from 14 seconds to 273 seconds.

simonbyrne commented 1 year ago

I bisected it to 78beabebd046a0c24a1872734485669498b793c9

avik-pal commented 1 year ago

Removing the @compile_workload brings down the precompile time from 690s to 29s locally :sweat:

ChrisRackauckas commented 1 year ago

This is solved. It's a v1.9 bug, so we'll only precompile on v1.10.