MagneticResonanceImaging / MRIReco.jl

Julia Package for MRI Reconstruction
https://magneticresonanceimaging.github.io/MRIReco.jl/latest/
Other
85 stars 22 forks source link

MRIReco load time #199

Open cncastillo opened 2 months ago

cncastillo commented 2 months ago

I was checking how long some packages were taking to load (as KomaMRI is taking around 3s to load), and I got the following results:

julia> @time using KomaMRI # This is a lot! around 1.4s is just loading MRIReco
  3.354859 seconds (6.92 M allocations: 351.951 MiB, 5.74% gc time, 13.79% compilation time: 26% of which was recompilation)
julia> @time using KomaMRICore # Base simulation package
  0.688178 seconds (906.46 k allocations: 59.652 MiB, 2.81% gc time, 20.73% compilation time: 78% of which was recompilation)
julia> @time using MRIReco
  1.399110 seconds (1.87 M allocations: 111.571 MiB, 2.10% gc time, 2.37% compilation time)

(v1.10) pkg> why Polynomials # 257.3 ms
  MRIReco → MRIOperators → Wavelets → DSP → Polynomials

(v1.10) pkg> why LowRankApprox # 646.0 ms
  MRIReco → MRIOperators → LowRankApprox

(v1.10) pkg> why FillArrays # 102.9 ms
  MRIReco → MRIOperators → Distributions → FillArrays

(v1.10) pkg> why Distributions # 207.6 ms
  MRIReco → MRIOperators → Distributions

(v1.10) pkg> why Unitful #  193.5 ms
  MRIReco → Unitful

Here, I just showed the packages that take more than 100ms to load (using @time_imports).

It may be worth considering moving some to a package extension. I would be happy to help, but I need an overall idea of why each package is needed.

LowRankApprox.jl is the heaviest, so that would be a good one to target or Distributions.jl. I believe that Unitful.jl could probably be easily moved to a package extension.