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

Use precompilation #53

Closed
jkosata opened this issue Oct 10, 2022 · 4 comments
Closed

Use precompilation #53

jkosata opened this issue Oct 10, 2022 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@jkosata
Copy link
Member

jkosata commented Oct 10, 2022

Just-in-time compilation times are getting pretty crazy (minutes). Most of the time, similar functions are used - get_harmonic_equations and get_steady_states. Precompilation could make this much more convenient.

Starting resource: https://julialang.org/blog/2021/01/precompile_tutorial/

@jkosata jkosata added the enhancement New feature or request label Oct 10, 2022
@oameye oameye self-assigned this Nov 20, 2022
@jkosata
Copy link
Member Author

jkosata commented Dec 11, 2022

Closer inspection shows things are quite complex.

@time_imports using HarmonicBalance shows that out of the ~60s, only 8s is HarmonicBalance, the rest are dependencies. A flamegraph shows that little time is spent on time inference, ruling out an easy fix.

More resources: https://discourse.julialang.org/t/taking-ttfx-seriously-can-we-make-common-packages-faster-to-load-and-use/74949/49

@jkosata
Copy link
Member Author

jkosata commented Dec 11, 2022

using SnoopCompile.@snoopr reveals there is a huge amount of invalidation coming from Arblib triggering the recompilation of some parts of OrdinaryDiffEq .

@oameye
Copy link
Member

oameye commented Dec 12, 2022

That most time was spent on compilation on dependencies rather than our own code I already suspected. We use the most notorious packages for precompilation time. Luckily, on Juliacon 2022 I picked up that a lot of the Julia masterminds are working on the problem. https://www.youtube.com/watch?v=N4h46_TCmGc

@jkosata jkosata mentioned this issue Dec 13, 2022
@oameye
Copy link
Member

oameye commented Jan 2, 2023

Looked into SnoopCompile.jl and the PR. Very cool stuff. Handy how it all just can be done by one macro. Nice that you also only added the less overhead SnoopPrecompile.jl version. Did you do a full analyses of the type instability with JET.jl as the documentation of SnoopCompile.jl suggests?

@oameye oameye closed this as completed Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants