Skip to content

Remove dependence on StaticArrays #244

Open
@jlapeyre

Description

@jlapeyre

Almost 80% of the time spent loading Graphs.jl is for loading StaticArrays.

Manifest.toml shows that the dependency path is QuantumDAGs $\to$ Graphs $\to$ ArnoldiMethod $\to$ StaticArrays.

ArnoldiMethod is imported into Graphs with using ArnoldiMethod so it's hard to track down where it is used (There is probably an easy way to find which symbols have been imported from a module, but I don't recall.) I tried commenting out using Arnoldi in src/Graphs.jl, but all tests still pass. I did find uses of partialeigen, partialschur, and LM.

I guess that either ArnoldiMethod could be made a weak dependency of Graphs, or StaticArrays could be made a weak dependency of ArnoldiMethod. [EDIT: This is speculation, they could be used internally for performance]

This is breaking unfortunately so it would have to wait for version 2.0. ... OTOH Maybe keeping ArnoldiMethod a hard dependency, but autoloading it would be possible.

 @time @time_imports using Graphs
     12.2 ms  MacroTools
      2.1 ms  SimpleTraits
      2.6 ms  StaticArraysCore
    575.4 ms  StaticArrays
      3.1 ms  ArnoldiMethod
      0.1 ms  Compat
      0.1 ms  Compat  CompatLinearAlgebraExt
      0.5 ms  Inflate
      7.0 ms  OrderedCollections
     67.2 ms  DataStructures
     37.7 ms  Graphs
  0.741944 seconds (1.68 M allocations: 124.559 MiB, 9.88% gc time, 2.79% compilation time)

julia> 575  / 741
0.7759784075573549

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions