Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using a Pkg extension to reduce package load time caused by StaticArrays #629

Closed
oschulz opened this issue Mar 2, 2023 · 4 comments
Closed

Comments

@oschulz
Copy link

oschulz commented Mar 2, 2023

Most of the load time of ForwardDiff is currently due to StaticArrays:

julia> @time_imports import ForwardDiff
      6.8 ms  IrrationalConstants
      0.7 ms  DiffRules
      2.8 ms  StaticArraysCore
      2.1 ms  DiffResults
     17.5 ms  Preferences
      0.2 ms  OpenLibm_jll
      0.3 ms  NaNMath
      2.7 ms  DocStringExtensions 58.56% compilation time
      0.7 ms  Compat
     66.5 ms  ChainRulesCore
      0.5 ms  ChangesOfVariables
      0.8 ms  InverseFunctions
      0.6 ms  LogExpFunctions
      0.2 ms  JLLWrappers
      3.4 ms  CompilerSupportLibraries_jll
      2.6 ms  OpenSpecFun_jll 85.33% compilation time
     15.0 ms  SpecialFunctions
     28.0 ms  MacroTools
      0.2 ms  CommonSubexpressions
    609.2 ms  StaticArrays
    150.9 ms  ForwardDiff

We could use the new Julia v1.9 Pkg weak dependency feature to massively reduce ForwardDiff's load time by creating extensions for StaticArrays (and maybe for ChainRulesCore as well). I had a look, I think StaticArrays is only used in methods that also have StaticArray as an argument type, ForwardDiff doesn't seem to use StaticArrays for internal required functionality.

@oschulz
Copy link
Author

oschulz commented Mar 2, 2023

Related to #591 and #599 .

@devmotion
Copy link
Member

This was implemented in #628 and #625.

@oschulz
Copy link
Author

oschulz commented Mar 2, 2023

Sorry @devmotion , no idea how I didn't see this.

@oschulz
Copy link
Author

oschulz commented Mar 2, 2023

Argh, I was working on an outdated master branch by mistake - sorry again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants