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

timed precompilation of package and dependents #3328

Closed
anandijain opened this issue Jan 20, 2023 · 3 comments · Fixed by #3334
Closed

timed precompilation of package and dependents #3328

anandijain opened this issue Jan 20, 2023 · 3 comments · Fixed by #3334

Comments

@anandijain
Copy link

anandijain commented Jan 20, 2023

https://julialang.slack.com/archives/C6A044SQH/p1674223081428299

I want to build something that allows me to plot how long precompilation takes for a package and all of it's dependencies across package and julia versions.

the end goal being something like https://perf.rust-lang.org/

the usage I had in mind was

using Pkg

timings = Pkg.precompile_timed("DifferentialEquations";recompile=true) # recompile to delete caches
timings # Vector{Pair{PackageSpec, Float64}}`

i'd love to take a swing at this if someone wants to give me some pointers on how to implement it

@timholy
Copy link
Sponsor Member

timholy commented Jan 20, 2023

I want to build something that allows me to plot how long precompilation takes for a package and all of it's dependencies across package and julia versions.

for juliabin in ("julia-1.6", "julia-1.7", "julia-1.8", "julia-1.9")   # customize these to the versions you have and how you launch them
    rm(expanduser("~/.julia/compiled/"); recursive=true)   # clear all precompiled files
    run(`$juliabin -e 'using Pkg; @time Pkg.precompile("ThePkgIWantToPrecompile")'`)
end

and do something to harvest the output of @time. You could, e.g., use @elapsed instead and write the returned time to a file.

(Script untested, but I'll leave that to you 😉 ).

@timholy timholy closed this as completed Jan 21, 2023
@anandijain
Copy link
Author

I think @IanButterworth was thinking of adding something to Pkg that gives not just a single package, but all dependents too.

Current progress is at the https://github.com/anandijain/JuliaBenchmarker.jl

@anandijain
Copy link
Author

Can we reopen? That script is helpful but doesn't give the breakdown that I'm looking for. It would be much more valuable to have the functionality akin to @time_imports that actually describes the time each took.

I realize I could just do this for each node in the dependency graph, but that doesn't seem like the right solution.

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 a pull request may close this issue.

3 participants