-
-
Notifications
You must be signed in to change notification settings - Fork 270
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
Improve latency for Pkg.add
#4115
Conversation
Before ``` julia> @time @eval Pkg.Registry.update() Updating registry at `~/.julia/registries/General.toml` 1.006864 seconds (2.18 M allocations: 148.068 MiB, 1.42% gc time, 43.47% compilation time: 6% of which was recompilation) ``` After ``` julia> @time @eval Pkg.Registry.update() Updating registry at `~/.julia/registries/General.toml` 0.677679 seconds (1.75 M allocations: 125.226 MiB, 2.03% gc time, 14.63% compilation time: 39% of which was recompilation) ```
For some reason, these don't seem to "take" on our precompile workload. Before: ``` 1.379429 seconds (3.39 M allocations: 211.476 MiB, 2.36% gc time, 60.64% compilation time: 38% of which was recompilation) ``` After: ``` 0.963989 seconds (2.83 M allocations: 182.510 MiB, 1.67% gc time, 42.22% compilation time: 75% of which was recompilation) ```
src/precompile.jl
Outdated
@@ -118,6 +118,7 @@ let | |||
Pkg.add(Pkg.PackageSpec(path = "TestPkg.jl/")) | |||
Pkg.update(; update_registry = false) | |||
Pkg.status() | |||
Pkg.Registry.update() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aren't we intentionally avoiding any internet activity? Or at least trying to i.e. Pkg.UPDATED_REGISTRY_THIS_SESSION[] = true
above.
I think there's an issue open but can't find it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought that since we already install a local registry it wouldn't go out to the internet to update anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
huh. Ok. I guess we can delete Pkg.UPDATED_REGISTRY_THIS_SESSION[] = true
and the update_registry = false
kwarg on Pkg.update
. Worth checking offline precompilation doesn't error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did get
┌ Warning: could not download https://pkg.julialang.org/registries
│ exception = RequestError: Could not resolve host: pkg.julialang.org while requesting https://pkg.julialang.org/registries
└ @ Pkg.Registry ~/JuliaPkgs/Pkg.jl/src/Registry/Registry.jl:77
without internet. With the explicit precompile
for updating registries it seems it wasn't super important so I took it away.
Before:
After: