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

DifferentialEquations Package Kills Performance Everywhere #947

Closed
leespen1 opened this issue Mar 21, 2023 · 2 comments
Closed

DifferentialEquations Package Kills Performance Everywhere #947

leespen1 opened this issue Mar 21, 2023 · 2 comments

Comments

@leespen1
Copy link

After loading the DifferentialEquations.jl package in the REPL, Julia seems to start performing very slowly, possibly only when text is output to the REPL, but in a way that makes the REPL extremely frustrating to use. Starting from a fresh Julia REPL session, I perform the following operations:

julia> @time a = [1,2,3,4]
  0.000009 seconds (1 allocation: 96 bytes)
4-element Vector{Int64}:
 1
 2
 3
 4

julia> using DifferentialEquations

julia> @time a = [1,2,3,4]
  0.000003 seconds (1 allocation: 96 bytes)
4-element Vector{Int64}:
 1
 2
 3
 4

julia> 

The first @time a = [1,2,3,4] is nearly instantaneous, as I would expect. But after using DifferentialEquations (which itself takes 30-60 seconds), nearly 10 seconds elapse between hitting enter after @time a = [1,2,3,4] and when I am able to type in the REPL again.

This is especially bad when an exception occurs. The stacktrace output can take over a minute to finish.

Why is the inclusion of the DifferentialEquations package so dramatically affecting the performance of seemingly unrelated operations, including those in Base? I have observed this behavior on two computers.

@devmotion
Copy link
Member

I assume this is the same as SciML/DiffEqBase.jl#895 and SciML/SciMLBase.jl#409: the show(::IO, ::Type{<:MyType}) implementations (via TruncatedStacktraces) cause a lot of invalidations.

@ChrisRackauckas
Copy link
Member

Fixed by making stacktraces huge.

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

3 participants