It takes several minutes to add a single package

FWIW, here is a benchmark of adding packages available locally. Takes a 3.4s in my cluttered global environment and 0.13s in a fresh --temp environment.

julia> using BenchmarkTools

julia> @btime Pkg.add("BenchmarkTools")
   Resolving package versions...
  No Changes to `~/.julia/environments/v1.6/Project.toml`
  No Changes to `~/.julia/environments/v1.6/Manifest.toml`
  ...
   Resolving package versions...
  No Changes to `~/.julia/environments/v1.6/Project.toml`
  No Changes to `~/.julia/environments/v1.6/Manifest.toml`
  3.399 s (5650138 allocations: 1008.12 MiB)

(@v1.6) pkg> activate --temp
  Activating new environment at `/var/folders/hc/fn82kz1j5vl8w7lwd4l079y80000gn/T/jl_okeivJ/Project.toml`

julia> @btime Pkg.add("BenchmarkTools")
   Resolving package versions...
    Updating `/private/var/folders/hc/fn82kz1j5vl8w7lwd4l079y80000gn/T/jl_okeivJ/Project.toml`
  [6e4b80f9] + BenchmarkTools v1.2.0
    Updating `/private/var/folders/hc/fn82kz1j5vl8w7lwd4l079y80000gn/T/jl_okeivJ/Manifest.toml`
  [6e4b80f9] + BenchmarkTools v1.2.0
  [682c06a0] + JSON v0.21.2
  [69de0a69] + Parsers v2.1.1
  [ade2ca70] + Dates
  [8f399da3] + Libdl
  [37e2e46d] + LinearAlgebra
  [56ddb016] + Logging
  [a63ad114] + Mmap
  [de0858da] + Printf
  [9abbd945] + Profile
  [9a3f8284] + Random
  [ea8e919c] + SHA
  [9e88b42a] + Serialization
  [2f01184e] + SparseArrays
  [10745b16] + Statistics
  [cf7118a7] + UUIDs
  [4ec0a83e] + Unicode
   Resolving package versions...
  No Changes to `/private/var/folders/hc/fn82kz1j5vl8w7lwd4l079y80000gn/T/jl_okeivJ/Project.toml`
  No Changes to `/private/var/folders/hc/fn82kz1j5vl8w7lwd4l079y80000gn/T/jl_okeivJ/Manifest.toml`
...
   Resolving package versions...
  No Changes to `/private/var/folders/hc/fn82kz1j5vl8w7lwd4l079y80000gn/T/jl_okeivJ/Project.toml`
  No Changes to `/private/var/folders/hc/fn82kz1j5vl8w7lwd4l079y80000gn/T/jl_okeivJ/Manifest.toml`
  129.347 ms (456395 allocations: 33.07 MiB)

As far as I’m aware both seem to be doing nothing and should be instant. I don’t think internet connection is an issue because I got similar results with wifi on and off.

@giordano, please let me know if I am missing something. Really, I find that either I am doing something wrong, or there is room for improvement here.

I am running this from our computer cluster, thus I cannot turn of the internet connection there. I have package called PDBTools.jl, and its latest version is 0.12.11.

Its latest version is installed in the “main” environment, as I will show bellow. Next, I create a temporary environment and try to add that same package. I have measured the time there.

What you will see there is not my everyday experience, because for some reason the internet connection I have at home (and I have been homeworking for a while…) deals better with the access with the package registries - I am not completely sure what that means, I can only feel the side effects.

If what I experience in the cluster was my everyday experience, I would never think of using Julia for anything.

That said, given that improving anything concerning the internet connection on that computer cluster is out of scope, I could deal with that if I was able to fine control how the package manager installs things taking into consideration what is already installed locally. It is conceivable to leave the installations running, get a everything I might need locally, and then use all that in every possible environment I might want to use locally in the cluster. Without that fine control and connection-independent use, using Julia there turns out to be very unpleasant.

This is what I get:

julia> status PDBTools
      Status `~/.julia/environments/v1.6/Project.toml`
  [e29189f1] PDBTools v0.12.11

(@v1.6) pkg> activate --temp
  Activating new environment at `/tmp/jl_SK8KPf/Project.toml`

julia> import Pkg

julia> @time Pkg.add("PDBTools")
    Updating registry at `~/.julia/registries/General`
    Updating git-repo `https://github.com/JuliaRegistries/General.git`
   Resolving package versions...
   Installed Parameters ─ v0.12.3
    Updating `/tmp/jl_SK8KPf/Project.toml`
  [e29189f1] + PDBTools v0.12.11
    Updating `/tmp/jl_SK8KPf/Manifest.toml`
  [59287772] + Formatting v0.4.2
  [bac558e1] + OrderedCollections v1.4.1
  [e29189f1] + PDBTools v0.12.11
  [d96e819e] + Parameters v0.12.3
  [3a884ed6] + UnPack v1.0.2
  [2a0f44e3] + Base64
  [b77e0a4c] + InteractiveUtils
  [56ddb016] + Logging
  [d6f4376e] + Markdown
  [de0858da] + Printf
  [9a3f8284] + Random
  [9e88b42a] + Serialization
  [8dfed614] + Test
  [4ec0a83e] + Unicode
Precompiling project...
  2 dependencies successfully precompiled in 5 seconds (3 already precompiled)
623.901732 seconds (9.11 M allocations: 372.894 MiB, 0.06% gc time, 0.09% compilation time)

julia>

as you can see, we are talking about 10 minutes to do something that is, essentially, nothing.

2 Likes
julia> using Pkg

help?> Pkg.offline
  Pkg.offline(b::Bool=true)

  Enable (b=true) or disable (b=false) offline mode.

  In offline mode Pkg tries to do as much as possible without connecting to internet. For example, when adding a package Pkg only considers versions that are already downloaded in version resolution.

  To work in offline mode across Julia sessions you can set the environment variable JULIA_PKG_OFFLINE to "true".

  │ Julia 1.5
  │
  │  Pkg's offline mode requires Julia 1.5 or later.

Yes, the difference is between a cluttered environment (where the resolver must keep happy more packages together) and a non-cluttered one. But it isn’t like the global environment is any special. But this looks to me one more reason to not have cluttered environments :slightly_smiling_face:

How’d the time be different if you had run the same command in the global environment?

2 Likes

The essential difference is that you only have to add a package once in the global environment, whereas you need to add it in each new local or temporary environment you create that needs it.

EDIT: Thank you @giordano for the correction. This used to say “…for each new temporary environment…”

2 Likes

Can you get more information about how the time is split between the different steps? Without more information I’m tempted to guess that your cluster has a file system which is slow at handling a large number of small files and that nearly all time is spent on updating the registry. If this is the case it would be interesting to see how Julia 1.7 fares when it’s not unpacking the registry.

2 Likes

What if you do this at the beginning of your Julia session?

julia> import Pkg

julia> Pkg.UPDATED_REGISTRY_THIS_SESSION[] = true

As bad. The problem is the download of the registries. I will try the Pkg.offline option (which, by the way, is not documented here, apparently).

The Pkg.offline options is what really improves my experience here:

julia> Pkg.offline(true)

julia> @time Pkg.add("PDBTools")
   Resolving package versions...
    Updating `/tmp/jl_iorxwT/Project.toml`
  [e29189f1] + PDBTools v0.12.11
    Updating `/tmp/jl_iorxwT/Manifest.toml`
  [59287772] + Formatting v0.4.2
  [bac558e1] + OrderedCollections v1.4.1
  [e29189f1] + PDBTools v0.12.11
  [d96e819e] + Parameters v0.12.3
  [3a884ed6] + UnPack v1.0.2
  [2a0f44e3] + Base64
  [b77e0a4c] + InteractiveUtils
  [56ddb016] + Logging
  [d6f4376e] + Markdown
  [de0858da] + Printf
  [9a3f8284] + Random
  [9e88b42a] + Serialization
  [8dfed614] + Test
  [4ec0a83e] + Unicode
  2.467132 seconds (3.48 M allocations: 205.214 MiB, 2.91% gc time, 6.54% compilation time)

It becomes fast:

julia> import Pkg

julia> Pkg.UPDATED_REGISTRY_THIS_SESSION[] = true
true

julia> @time Pkg.add("PDBTools")
   Resolving package versions...
  No Changes to `~/.julia/environments/v1.6/Project.toml`
  No Changes to `~/.julia/environments/v1.6/Manifest.toml`
  5.910878 seconds (5.07 M allocations: 320.312 MiB, 1.37% gc time, 5.82% compilation time)

(@v1.6) pkg> activate --temp
  Activating new environment at `/tmp/jl_pMQIWm/Project.toml`

julia> @time Pkg.add("PDBTools")
   Resolving package versions...
    Updating `/tmp/jl_pMQIWm/Project.toml`
  [e29189f1] + PDBTools v0.12.11
    Updating `/tmp/jl_pMQIWm/Manifest.toml`
  [59287772] + Formatting v0.4.2
  [bac558e1] + OrderedCollections v1.4.1
  [e29189f1] + PDBTools v0.12.11
  [d96e819e] + Parameters v0.12.3
  [3a884ed6] + UnPack v1.0.2
  [2a0f44e3] + Base64
  [b77e0a4c] + InteractiveUtils
  [56ddb016] + Logging
  [d6f4376e] + Markdown
  [de0858da] + Printf
  [9a3f8284] + Random
  [9e88b42a] + Serialization
  [8dfed614] + Test
  [4ec0a83e] + Unicode
  0.468187 seconds (807.31 k allocations: 67.419 MiB, 6.85% gc time, 52.59% compilation time)

julia> 

The problem is on fetching the registry there (downloading the Julia tarball took 3 seconds):

I feel like you are conflating local environments with temporary environments. I suggest using temporary ones when you want to do a quick test with a new package that you may not use anymore. If you want to have something persistent, you create a local environment.

So, I really don’t understand the point you’re trying to make about putting all packages in the global environment.

1 Like

Because once the package is in the global environment, I don’t need to install them again in the temporary environments to test things. That is why.

If I am developing let say package “A” in the environment of A, and I happen to need some other package there for testing something, I have to add it to that environment, or simply use it from the global environment.

As you can see, using it is “free”. Adding it to the local environment (now I know that I can improve that by using Pkg.offline(true) or the updated registry thing) may take several minutes.

From that screenshot, it looks like you are using the Git version of the General registry. In order to get the registry speedups in Julia 1.7 that @GunnarFarneback was talking about, you will need to be using the Pkg server version of the General registry.

In order to switch to the Pkg server version of the General registry, run the following commands:

julia> import Pkg

julia> Pkg.Registry.rm("General")

julia> delete!(ENV, "JULIA_PKG_SERVER")

julia> Pkg.Registry.add("General")
6 Likes

Then create a local environment? As I said above, my point is to not clutter the global environment. Temporary environments are… well… temporary, I do not recommend them to put packages you know you want to use later on

1 Like

Perhaps I am misunderstanding “proper” use of local environments.

Let’s say I have 10 projects, that require an overlapping set of packages, say, each project has 3–5 packages it alone uses, 10–20 packages it shares with a couple other projects, and 5–10 packages that it shares with most projects. (Each of these direct requirements also has its own dependency tree.) When I initially create a package I don not know exactly what packages it will need, so I have to add them incrementally with ]add Xxx Yyy one or two at a time.

Are you recommending I put 5 packages in my global environment, create 10 local environments and install the remaining requisite 18–30 packages individually in each of the ten local environments?

Thanks! (Does this have side effects folks should be aware of that span Julia sessions?)

Let us say that I am developing my package PDBTools. Then, I am working in the environment PDBTools pkg>. I happen to need to draw a plot, but Plots is not a dependency of my package at all.

If Plots is installed in the global environment, I just need to do using Plots. If not, what do I do?

I am getting this error message, and it does not seem to be working (or is it?). In any case, it is taking a lot of time anyway:

That could be a good middle ground, yes.

I tend to be more extreme and have only dev packages (BenchmarkTools, Revise, little else) in the global environment and then for all other tasks I use local environments. Local environments are useful for reproducibility: if I put all packages I need for an application in its local environment I can check in the manifest with Git and give it to others, who can simply instantiate the environment and have everything ready to use. If you rely on packages installed in your own global environment that’s not going to work.

4 Likes

So the issue I see with that approach is that it takes some time to install a single package and when we multiply by 10*(18–30) we get 180–300 package installations. This is a lot of avoidable work for me because I only actually need to have a reproducible environment for two of those ten projects. With the global environment system I can install all 60 packages I have ever used in my global environment and then only go through manual installation in local environments 36–60 times for a total of 96–120 package installations rather than 180–300.

It’d be even nicer if the 36-60 manual instillations to create reproducible environments was automated, leaving me with only 60 in the global environment (3x–5x savings at the UI level)

I explain this alternative in detail above:

From the discussion above, an alternative workflow can be:

  1. Start a temporary environment.
  2. Add every possible package you may wan to use to that temporary environment (i. e. download everything).
  3. Add Pkg.offline(true) and perhaps Pkg.UPDATED_REGISTRY_THIS_SESSION[] = true to startup.jl.

Than you can add packages quickly to new environments, temporary or not, all the time, and the main environment has no package whatsoever.

It still does not solve the fact that you cannot use those packages without installing them in each environment, but at least the interaction will be swift.

I’ve profiled, with the following results:
24% (~1s) resolve
23% (~1s) precompile
49% (~2s) handle interrupt (I did not trigger any keyboard interrupts during profiling)

Precompile shouldn’t be happening because there are no changes to the manifest, right?
And I have no idea what handle interrupt is (@Base/task.jl:411; (::Pkg.API.var"#212#239"{Bool, Vector{Task}, Pkg.API.var"#handle_interrupt#231"{Base.Event, ReentrantLo...).

In detail:

Overhead ╎ [+additional indent] Count File:Line; Function
=========================================================
     ╎26790  @Base/client.jl:485; _start()
     ╎ 26790  @Base/client.jl:302; exec_options(opts::Base.JLOptions)
     ╎  26790  @Base/client.jl:372; run_main_repl(interactive::Bool, quiet::Bool, banner::Bool, history_file::Bool, color_set::Bool)
     ╎   26790  @Base/essentials.jl:706; invokelatest
     ╎    26790  @Base/essentials.jl:708; #invokelatest#2
     ╎     26790  @Base/client.jl:387; (::Base.var"#874#876"{Bool, Bool, Bool})(REPL::Module)
     ╎    ╎ 26790  ...ackage_macos64/build/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:305; run_repl(repl::REPL.AbstractREPL, consumer::Any)
     ╎    ╎  26790  ...ackage_macos64/build/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:317; run_repl(repl::REPL.AbstractREPL, consumer::Any; backend_on_current_task::Bool)
     ╎    ╎   26790  ...ackage_macos64/build/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:185; start_repl_backend(backend::REPL.REPLBackend, consumer::Any)
     ╎    ╎    26790  ...ckage_macos64/build/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:200; repl_backend_loop(backend::REPL.REPLBackend)
     ╎    ╎     26790  ...ckage_macos64/build/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:139; eval_user_input(ast::Any, backend::REPL.REPLBackend)
     ╎    ╎    ╎ 26790  @Base/boot.jl:360; eval
     ╎    ╎    ╎  26790  REPL[37]:2; top-level scope
     ╎    ╎    ╎   26790  ...acos64/build/usr/share/julia/stdlib/v1.6/Profile/src/Profile.jl:28; macro expansion
     ╎    ╎    ╎    26789  @Base/timing.jl:210; macro expansion
     ╎    ╎    ╎     26789  ...ckage_macos64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:74; add
     ╎    ╎    ╎    ╎ 26789  ...ckage_macos64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:74; #add#22
     ╎    ╎    ╎    ╎  26789  ...kage_macos64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:75; add
     ╎    ╎    ╎    ╎   26789  ...kage_macos64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:75; #add#23
     ╎    ╎    ╎    ╎    26789  ...kage_macos64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:77; add(pkgs::Vector{Pkg.Types.PackageSpec})
     ╎    ╎    ╎    ╎     14423  ...age_macos64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:79; add(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::Base.Iterators.Pairs{Union{},...
     ╎    ╎    ╎    ╎    ╎ 14423  ...ge_macos64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:154; (::Pkg.API.var"#add##kw")(::NamedTuple{(:io,), Tuple{Base.TTY}}, ::typeof(Pkg.API.add), ctx...
     ╎    ╎    ╎    ╎    ╎  14416  ...ge_macos64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:203; add(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; preserve::Pkg.Types.Prese...
     ╎    ╎    ╎    ╎    ╎   14416  ...64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Operations.jl:1223; add##kw
     ╎    ╎    ╎    ╎    ╎    12373  ...64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Operations.jl:1231; add(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}, new_git::Vector{Base.UU...
     ╎    ╎    ╎    ╎    ╎     12366  ...4/build/usr/share/julia/stdlib/v1.6/Pkg/src/Operations.jl:1216; _resolve
     ╎    ╎    ╎    ╎    ╎    ╎ 12366  ...4/build/usr/share/julia/stdlib/v1.6/Pkg/src/Operations.jl:1182; tiered_resolve(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec})
     ╎    ╎    ╎    ╎    ╎    ╎  11831  ...4/build/usr/share/julia/stdlib/v1.6/Pkg/src/Operations.jl:1210; targeted_resolve(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}, preserve:...
     ╎    ╎    ╎    ╎    ╎    ╎   9618   ...4/build/usr/share/julia/stdlib/v1.6/Pkg/src/Operations.jl:404; resolve_versions!(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec})
     ╎    ╎    ╎    ╎    ╎    ╎    4254   .../build/usr/share/julia/stdlib/v1.6/Pkg/src/Operations.jl:534; deps_graph(ctx::Pkg.Types.Context, uuid_to_name::Dict{Base.UUID, String}, reqs::Dict{B...
     ╎    ╎    ╎    ╎     11944  ...age_macos64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:80; add(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::Base.Iterators.Pairs{Union{},...
     ╎    ╎    ╎    ╎    ╎ 11943  ...ge_macos64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Pkg.jl:592; _auto_precompile(ctx::Pkg.Types.Context)
    1╎    ╎    ╎    ╎    ╎  11943  ...ge_macos64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:920; (::Pkg.API.var"#precompile##kw")(::NamedTuple{(:internal_call,), Tuple{Bool}}, ::typeof(Pk...
     ╎    ╎    ╎    ╎    ╎   3737   ...e_macos64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:921; precompile(ctx::Pkg.Types.Context; internal_call::Bool, strict::Bool, kwargs::Base.Iterat...
     ╎    ╎    ╎    ╎    ╎    3737   ...e_macos64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:1304; (::Pkg.API.var"#instantiate##kw")(::NamedTuple{(:allow_autoprecomp,), Tuple{Bool}}, ::ty...
     ╎    ╎    ╎    ╎    ╎     3669   ..._macos64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:1335; instantiate(ctx::Pkg.Types.Context; manifest::Nothing, update_registry::Bool, verbose::B...
     ╎    ╎    ╎    ╎    ╎    ╎ 3651   ...4/build/usr/share/julia/stdlib/v1.6/Pkg/src/Operations.jl:131; is_instantiated(ctx::Pkg.Types.Context)
     ╎    ╎    ╎    ╎    ╎    ╎  3651   @Base/reducedim.jl:886; all
     ╎    ╎    ╎    ╎    ╎    ╎   3651   @Base/reducedim.jl:886; #all#698
     ╎    ╎    ╎    ╎    ╎    ╎    3651   @Base/reduce.jl:923; _all
     ╎    ╎    ╎    ╎    ╎    ╎     3651   .../build/usr/share/julia/stdlib/v1.6/Pkg/src/Operations.jl:131; #13
     ╎    ╎    ╎    ╎    ╎    ╎    ╎ 3589   ...build/usr/share/julia/stdlib/v1.6/Pkg/src/Operations.jl:1786; is_package_downloaded(ctx::Pkg.Types.Context, pkg::Pkg.Types.PackageSpec)
     ╎    ╎    ╎    ╎    ╎    ╎    ╎  3589   ...build/usr/share/julia/stdlib/v1.6/Pkg/src/Operations.jl:713; check_artifacts_downloaded
    5╎    ╎    ╎    ╎    ╎   4157   ...e_macos64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:981; precompile(ctx::Pkg.Types.Context; internal_call::Bool, strict::Bool, kwargs::Base.Iterat...
     ╎    ╎    ╎    ╎    ╎    4143   ...e_macos64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:978; (::Pkg.API.var"#in_deps#227")(pkgs::Vector{Base.PkgId}, deps::Vector{Base.PkgId}, dmap::D...
     ╎    ╎    ╎    ╎    ╎     4143   @Base/reducedim.jl:883; any
     ╎    ╎    ╎    ╎    ╎    ╎ 4143   @Base/reducedim.jl:883; #any#696
     ╎    ╎    ╎    ╎    ╎    ╎  4143   @Base/reduce.jl:876; _any(f::Pkg.API.var"#204#228"{Vector{Base.PkgId}, Dict{Base.PkgId, Vector{Base.PkgId}}}...
     ╎    ╎    ╎    ╎    ╎    ╎   4143   ..._macos64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:978; (::Pkg.API.var"#204#228"{Vector{Base.PkgId}, Dict{Base.PkgId, Vector{Base.PkgId}}})(dep...
     ╎    ╎    ╎    ╎    ╎    ╎    4061   ...macos64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:978; (::Pkg.API.var"#in_deps#227")(pkgs::Vector{Base.PkgId}, deps::Vector{Base.PkgId}, dma...
     ╎    ╎    ╎    ╎    ╎    ╎     4061   @Base/reducedim.jl:883; any
     ╎    ╎    ╎    ╎    ╎    ╎    ╎ 4061   @Base/reducedim.jl:883; #any#696
     ╎    ╎    ╎    ╎    ╎    ╎    ╎  4057   @Base/reduce.jl:876; _any(f::Pkg.API.var"#204#228"{Vector{Base.PkgId}, Dict{Base.PkgId, Vector{Base.PkgId...
     ╎    ╎    ╎    ╎    ╎    ╎    ╎   4057   ...acos64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:978; (::Pkg.API.var"#204#228"{Vector{Base.PkgId}, Dict{Base.PkgId, Vector{Base.PkgId}}})(...
     ╎    ╎    ╎    ╎    ╎    ╎    ╎    3798   ...cos64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:978; (::Pkg.API.var"#in_deps#227")(pkgs::Vector{Base.PkgId}, deps::Vector{Base.PkgId}, ...
     ╎    ╎    ╎    ╎    ╎    ╎    ╎     3798   @Base/reducedim.jl:883; any
     ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎ 3798   @Base/reducedim.jl:883; #any#696
     ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎  3789   @Base/reduce.jl:876; _any(f::Pkg.API.var"#204#228"{Vector{Base.PkgId}, Dict{Base.PkgId, Vector{Base.Pk...
   12╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎   3789   ...os64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:978; (::Pkg.API.var"#204#228"{Vector{Base.PkgId}, Dict{Base.PkgId, Vector{Base.PkgId}}...
     ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    3474   ...s64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:978; (::Pkg.API.var"#in_deps#227")(pkgs::Vector{Base.PkgId}, deps::Vector{Base.PkgId...
     ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     3474   @Base/reducedim.jl:883; any
     ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎ 3474   @Base/reducedim.jl:883; #any#696
     ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎  3469   @Base/reduce.jl:876; _any(f::Pkg.API.var"#204#228"{Vector{Base.PkgId}, Dict{Base.PkgId, Vector{Base...
    9╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎   3469   ...64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:978; (::Pkg.API.var"#204#228"{Vector{Base.PkgId}, Dict{Base.PkgId, Vector{Base.PkgI...
    1╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    3286   ...4/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:978; (::Pkg.API.var"#in_deps#227")(pkgs::Vector{Base.PkgId}, deps::Vector{Base.Pk...
     ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     3285   @Base/reducedim.jl:883; any
     ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎ 3285   @Base/reducedim.jl:883; #any#696
     ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎  3280   @Base/reduce.jl:876; _any(f::Pkg.API.var"#204#228"{Vector{Base.PkgId}, Dict{Base.PkgId, Vector{B...
   11╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎   3280   .../build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:978; (::Pkg.API.var"#204#228"{Vector{Base.PkgId}, Dict{Base.PkgId, Vector{Base.P...
     ╎    ╎    ╎    ╎    ╎   3409   ...e_macos64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:1098; precompile(ctx::Pkg.Types.Context; internal_call::Bool, strict::Bool, kwargs::Base.Iterat...
     ╎    ╎    ╎    ╎    ╎    3138   @Base/loading.jl:290; locate_package(pkg::Base.PkgId)
   11╎25689  @Base/task.jl:411; (::Pkg.API.var"#212#239"{Bool, Vector{Task}, Pkg.API.var"#handle_interrupt#231"{Base.Event, ReentrantLo...
     ╎ 24550  ...er/package_macos64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:1126; macro expansion
    1╎  24542  ...er/package_macos64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:904; _is_stale
    6╎   8281   @Base/loading.jl:1716; stale_cachefile(modpath::String, cachefile::String)
     ╎    6712   @Base/loading.jl:290; locate_package(pkg::Base.PkgId)
    4╎     5416   @Base/loading.jl:396; manifest_uuid_path(env::String, pkg::Base.PkgId)
    3╎   14504  @Base/loading.jl:1750; stale_cachefile(modpath::String, cachefile::String)
     ╎    13681  @Base/loading.jl:254; identify_package(where::Base.PkgId, name::String)
   65╎     12903  @Base/loading.jl:379; manifest_deps_get(env::String, where::Base.PkgId, name::String)
   45╎    ╎ 3048   @Base/loading.jl:503; explicit_manifest_deps_get(project_file::String, where::Base.UUID, name::String)
     ╎    ╎  3003   @Base/uuid.jl:82; UUID

This should probably be a local environment so that you can keep it across Julia sessions.

That depends on the environment, I’ve experienced between .1 and 8 seconds depending on the environment and the time of day (all without using any internet connection).

I completely understand the importance and utility of this, but this is not how people use packages, nor never will be. No package user guide starts saying to the user to download a Manifest file and instantiate anything. Manuals say: install the package, start using it.

I think most people is coming in contact with environments not because of the features, but because they are a sort of annoying workaround for the fact that just using a lot of packages in the global environment starts to become problematic whenever a new package or update occurs.

I my humble opinion, making Julia deal well with a cluttered main environment would be a significant user experience improvement for the majority of users, and requires a more conservative approach to updates (update only if necessary, warn the user about the version available, etc.).

2 Likes