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

RFC: only auto precompile the added package (+ deps) after an add operation #3848

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

KristofferC
Copy link
Sponsor Member

Many times in the global env I add some small package to try it out and then Pkg starts precompiling everything (even things I did not intend to load). This means I often have to interrupt it (which is a bit brittle) and it feels like it is doing something I didn't ask it to do.

With this, it will only compile the deps graph of the added packages. If a user want to load some other package later, the load precompile step will pick that up.

@KristofferC KristofferC added the precompile Pkg.precompile label Mar 18, 2024
@IanButterworth
Copy link
Sponsor Member

The current approach aims at having the only thing that should cause load-time precompilation being changes to dev-ed packages. This moves more precompilation back to load time, when deps of other packages are changed by an add, which IMO would be a UX regression. But perhaps this is popular?

Personally I prefer the current arrangement and using the tiered_installed resolve strategy. Less changes, precompilation stays at install time.

@KristofferC
Copy link
Sponsor Member Author

KristofferC commented Mar 18, 2024

The current approach aims at having the only thing that should cause load-time precompilation being changes to dev-ed packages.

Yeah, of course, if you precompile the world once you don't have to precompile it later.

which IMO would be a UX regression

Well, it is not a straight-up regression, it is a trade-off. It is a big win in the cases where you do add Foo; using Foo; Foo.do_what_I_want() in that it takes 10s, and not 10 minutes because you happen to have OrdinaryDiffEq also in the env (which I wasn't going to use).


To be honest, with load time precompilation I probably don't see much personal value in the add precompile. Maybe I'll just turn it off 🤷‍♂️ .

@IanButterworth
Copy link
Sponsor Member

I think we might have opposite opinions on this. Might be worth fielding opinions on slack?

@IanButterworth
Copy link
Sponsor Member

A fancy solution would be to be specific like this PR, but spawn off the rest of the Project work as a background thing afterwards.

The UI of that needs figuring out, but it might not be too tricky..

  • notify that the rest of the project is being precompiled in the background. Use pkg> precompile --stop to interrupt
  • always be silent, don't report success or errors

Pidfile locking should protect against races and we already report if the current process is holding the lock in an async task.

@KristofferC
Copy link
Sponsor Member Author

Right now, there is no way to turn off full precompilation of env on add while keeping precompilation of test env. :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
precompile Pkg.precompile
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants