gdalle / DifferentiationInterface.jl

An interface to various automatic differentiation backends in Julia.
https://gdalle.github.io/DifferentiationInterface.jl/DifferentiationInterface
MIT License
163 stars 12 forks source link

Reduce load time? #416

Closed gdalle closed 5 days ago

gdalle commented 3 weeks ago

At the moment the main culprit is SparseArrays. I can get rid of it except for DenseSparsityDetector.

julia> @time_imports using DifferentiationInterface
      2.6 ms  ADTypes
      0.5 ms  Compat
      0.2 ms  Compat → CompatLinearAlgebraExt
               ┌ 0.0 ms DocStringExtensions.__init__() 
     29.7 ms  DocStringExtensions 95.35% compilation time
     40.9 ms  FillArrays
      0.2 ms  PackageExtensionCompat
               ┌ 0.7 ms SuiteSparse_jll.__init__() 
      0.9 ms  SuiteSparse_jll
               ┌ 7.5 ms SparseArrays.CHOLMOD.__init__() 96.44% compilation time
    302.8 ms  SparseArrays 2.39% compilation time
      2.9 ms  FillArrays → FillArraysSparseArraysExt
     27.3 ms  DataStructures
      1.2 ms  SparseMatrixColorings
               ┌ 0.0 ms DifferentiationInterface.__init__() 
      3.5 ms  DifferentiationInterface
gdalle commented 3 weeks ago

Moving the sparse AD code into an extension is possible (see #417) but breaking so not right now.

gdalle commented 1 week ago

SparseArrays solved by #448

gdalle commented 5 days ago

DocString extensions removed by #450 and FillArrays removed by #453. This package is now as pure as can be