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

Remove some background packages to greatly improve startup time #835

Merged
merged 2 commits into from
Dec 24, 2021

Conversation

ChrisRackauckas
Copy link
Member

Most of these packages were undocumented in terms of the DiffEq docs (https://diffeq.sciml.ai/stable/). A few of them had a page mentioning them and pointing to a separate documentation, so they really weren't a part of the package. The only one that really was somewhat core was ParameterizedFunctions.jl, but it was removed from the documentation in 2019. We're now entering 2022 and that deprecated functionality is the cause of more than half of the dependencies because it pulls in ModelingToolkit and the whole symbolic stack. Going into 2022, SciML now separately documents all of the tools which aren't solvers, so DifferentialEquations.jl is about solvers. These don't fit the bill, they add a ton of dependencies, they add a bunch of startup time, so it's time they go bye bye from here.

Result:

# Before
julia> @time using DifferentialEquations
  8.694322 seconds (24.77 M allocations: 1.736 GiB, 7.27% gc time, 17.92% compilation time)

# After
julia> @time using DifferentialEquations
  5.761738 seconds (18.00 M allocations: 1.327 GiB, 4.54% gc time, 10.38% compilation time)

Not to mention precompilation is no longer the easiest way to heat yourself for the winter.

Merry Christmas. I'm going to find other ways to improve that startup time as well.

@YingboMa is there a good way to warn users? I want to just give one warning for @ode_def and say "Warning: @ode_def is no longer included with DifferentialEquations.jl. Please directly add ParameterizedFunctions.jl" if someone tries to use it? Most users of DiffEq directly won't be savvy enough to read News.md for this.

Most of these packages were undocumented in terms of the DiffEq docs (https://diffeq.sciml.ai/stable/). A few of them had a page mentioning them and pointing to a separate documentation, so they really weren't a part of the package. The only one that really was somewhat core was ParameterizedFunctions.jl, but it was removed from the documentation in 2019. We're now entering 2022 and that deprecated functionality is the cause of more than half of the dependencies because it pulls in ModelingToolkit and the whole symbolic stack. Going into 2022, SciML now separately documents all of the tools which aren't solvers, so DifferentialEquations.jl is about solvers. These don't fit the bill, they add a ton of dependencies, they add a bunch of startup time, so it's time they go bye bye from here.

Result:

```julia
# Before
julia> @time using DifferentialEquations
  8.694322 seconds (24.77 M allocations: 1.736 GiB, 7.27% gc time, 17.92% compilation time)

# After
julia> @time using DifferentialEquations
  5.761738 seconds (18.00 M allocations: 1.327 GiB, 4.54% gc time, 10.38% compilation time)
```

Not to mention precompilation is no longer the easiest way to heat yourself for the winter. 

Merry Christmas. I'm going to find other ways to improve that startup time as well.

@YingboMa is there a good way to warn users? I want to just give one warning for `@ode_def` and say "Warning: `@ode_def` is no longer included with DifferentialEquations.jl. Please directly add ParameterizedFunctions.jl" if someone tries to use it? Most users of DiffEq directly won't be savvy enough to read News.md for this.
@ChrisRackauckas
Copy link
Member Author

I commented out the Requires.jl usage in ArrayInterface, RecursiveArrayTools, and DiffEqBase and got:

julia> @time using DifferentialEquations
  5.601273 seconds (17.82 M allocations: 1.318 GiB, 5.27% gc time, 9.17% compilation time)

but the profile says it's all Requires.jl time. What package is doing this?

@codecov
Copy link

codecov bot commented Dec 24, 2021

Codecov Report

Merging #835 (07f47e3) into master (959a2ac) will increase coverage by 2.57%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #835      +/-   ##
==========================================
+ Coverage   75.65%   78.23%   +2.57%     
==========================================
  Files          10       10              
  Lines         152      147       -5     
==========================================
  Hits          115      115              
+ Misses         37       32       -5     
Impacted Files Coverage Δ
src/default_solve.jl 100.00% <ø> (+45.45%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 959a2ac...07f47e3. Read the comment docs.

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.

1 participant