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

Improve latency for Pkg.add #4115

Merged
merged 4 commits into from
Dec 17, 2024
Merged

Improve latency for Pkg.add #4115

merged 4 commits into from
Dec 17, 2024

Conversation

KristofferC
Copy link
Member

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)

KristofferC added 2 commits December 16, 2024 14:33
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)
```
@@ -118,6 +118,7 @@ let
Pkg.add(Pkg.PackageSpec(path = "TestPkg.jl/"))
Pkg.update(; update_registry = false)
Pkg.status()
Pkg.Registry.update()
Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member Author

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.

@KristofferC KristofferC merged commit a1cfc6d into master Dec 17, 2024
7 checks passed
@KristofferC KristofferC deleted the kc/latency_reg_update branch December 17, 2024 12:01
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.

2 participants