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

Weak deps/Extension pkgs on Unitful?

Open anandijain opened this issue 2 years ago • 2 comments

julia> @time_imports using SBML
      2.5 ms  Zlib_jll
      3.1 ms  Libiconv_jll
      1.8 ms  XML2_jll
     63.9 ms  SBML_jll
      1.9 ms  DocStringExtensions
     10.9 ms  IfElse
      8.6 ms  ConstructionBase
    832.3 ms  Unitful
    160.4 ms  SBML

I usually don't use the Unitful stuff, so maybe it would be a good candidate for https://pkgdocs.julialang.org/dev/creating-packages/#Weak-dependencies

this is off the cuff, no urgency

anandijain avatar Jan 25 '23 16:01 anandijain

Hi, yeah this is very true and actually one of the reason I had to remove symbolics (the overhead of these was just too much). If there's some straightforward and reliable way to make unitful load on demand, let's do it. We could even push Unitful to a separate package (UnitfulSBML.jl? :D ), but l'd still prefer something that leaves the repo in one piece.

Btw, how does the Julia1.9 precompilation speedup affect unitful? Wouldn't there be some opportunity to massively fix the load times by fixing methods, like as happened with JuMP?

exaexa avatar Jan 25 '23 16:01 exaexa

just for the record, with julia 1.11 we're at this:

julia> @time_imports using SBML
      0.6 ms  Printf
     26.4 ms  Dates
      0.7 ms  TOML
     12.5 ms  Preferences
      0.5 ms  JLLWrappers
               ┌ 0.1 ms Zlib_jll.__init__() 
    142.2 ms  Zlib_jll 97.45% compilation time
               ┌ 5.2 ms Libiconv_jll.__init__() 92.35% compilation time
      5.8 ms  Libiconv_jll 83.70% compilation time
               ┌ 0.4 ms XML2_jll.__init__() 
      1.0 ms  XML2_jll
               ┌ 7.1 ms SBML_jll.__init__() 
      7.5 ms  SBML_jll
               ┌ 0.0 ms NetworkOptions.__init__() 
      3.4 ms  NetworkOptions
               ┌ 0.7 ms MbedTLS_jll.__init__() 
      4.8 ms  MbedTLS_jll
               ┌ 0.2 ms LibSSH2_jll.__init__() 
      4.2 ms  LibSSH2_jll
               ┌ 0.3 ms LibGit2_jll.__init__() 
      4.1 ms  LibGit2_jll
     11.3 ms  LibGit2
               ┌ 0.0 ms DocStringExtensions.__init__() 
      1.1 ms  DocStringExtensions
      0.1 ms  IfElse
               ┌ 1.3 ms SuiteSparse_jll.__init__() 
      4.5 ms  SuiteSparse_jll
      1.1 ms  Serialization
               ┌ 10.4 ms SparseArrays.CHOLMOD.__init__() 94.56% compilation time
    183.4 ms  SparseArrays 5.34% compilation time
    201.7 ms  Unitful
     46.3 ms  SBML

I think unitful code might eventually get somehow virtualized out.

exaexa avatar Jan 05 '25 12:01 exaexa