Skip to content

Handle dependencies via Pkg extensions #208

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

Merged
merged 1 commit into from
Jun 27, 2023
Merged

Handle dependencies via Pkg extensions #208

merged 1 commit into from
Jun 27, 2023

Conversation

dkarrasch
Copy link
Member

@dkarrasch dkarrasch commented Jun 27, 2023

This handles the two dependencies SparseArrays.jl and Statistics.jl as weak dependencies. Indeed, the only reason LinearMaps.jl depended on these was to overload their functions. Otherwise, LinearMaps.jl has always been independent from these two. Moreover, users could not call, say, sparse without loading SparseArrays.jl, so this is a clear case. This brings package load time of pure LinearMaps.jl down to below 20 ms (from about 300 ms, if not 500 ms and more) on current Julia nightly with SparseArrays.jl out of the sysimage).

Resolves #207.

@codecov
Copy link

codecov bot commented Jun 27, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (f522a8f) 99.67% compared to head (98d1014) 99.67%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #208   +/-   ##
=======================================
  Coverage   99.67%   99.67%           
=======================================
  Files          19       21    +2     
  Lines        1538     1540    +2     
=======================================
+ Hits         1533     1535    +2     
  Misses          5        5           
Impacted Files Coverage Δ
src/LinearMaps.jl 100.00% <ø> (ø)
src/conversion.jl 100.00% <ø> (ø)
src/linearcombination.jl 100.00% <ø> (ø)
src/wrappedmap.jl 100.00% <ø> (ø)
ext/LinearMapsSparseArraysExt.jl 100.00% <100.00%> (ø)
ext/LinearMapsStatisticsExt.jl 100.00% <100.00%> (ø)
src/blockmap.jl 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@dkarrasch
Copy link
Member Author

@oschulz This should help your package, shouldn't it? It seems like your package doesn't depend on SparseArrays.jl, so you would avoid loading it, at least via LinearMaps.jl.

@oschulz
Copy link
Contributor

oschulz commented Jun 27, 2023

@oschulz This should help your package, shouldn't it?

Yes, definitely! I have this MatrixLikeOperator in there only to keep load time down and to experiment with an operator that subtypes AbstractMatrix. I currently use LinearMaps via an extension - as soon as a ``MatrixLikeOperatoris multipled with aLinearOperator` the result is "promoted" to a `LinearOperator`. But if `LinearOperators` becomes even more lightweight I may be able to throw this `MatrixLikeOperator` out completely.

@dkarrasch dkarrasch merged commit b6b1044 into master Jun 27, 2023
@dkarrasch dkarrasch deleted the dk/extensions branch June 27, 2023 16:27
@oschulz
Copy link
Contributor

oschulz commented Jun 27, 2023

Nice, LinearMaps loads in 19 ms now. :-)

@oschulz
Copy link
Contributor

oschulz commented Jun 27, 2023

Are you tagging a new relase with this @dkarrasch ?

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

Successfully merging this pull request may close these issues.

Further reducing load time?
2 participants