-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
use a fixed world for code loading #49525
Conversation
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.
This seems like a good tradeoff to me.
If people want to circumvent this when they're developing the loading code, can't they just do
Base._require_world_age[] = typemax(UInt)
?
can this also be done for repl tab completions? |
This can and probably should be done for any Julia "session infrastructure" or compiler-related stuff which is
REPL keybindings are an interesting case - we can't choose a fixed world for all key bindings because packages add to the keybinding mappings. Rather, packages which extend the keybindings need to choose an appropriate world age when the keybinding is installed. For example I did this for OhMyREPL in KristofferC/OhMyREPL.jl#321 If the REPL had an API for adding keybindings, it would make sense to capture the world age when the keybinding was added and to replace the current use of However that's a separate PR. |
After #49604, I am not sure I have a concrete case in the wild where this is needed. |
I still think it's a good idea to shield this (and other) parts of the Julia core implementation from user invalidations. (With an opt-out for Base developers, which we do have here.) We already have this for |
598b765
to
703aa82
Compare
Okay, I am seeing |
I found a neat way to express the fixed world age in So an option would be to steal the |
Hm, for this specific case, I don't think it brings much clarity over just doing it manually. |
@nanosoldier |
Your package evaluation job has completed - possible new issues were detected. |
Let's try this then. |
This reverts commit 59bf9e8.
Code loading
Base.require
is one function that keeps getting run over and over as packages gets loaded. It is therefore important that this function does not get invalidated because having to recompile it causes significant latency. A lot of work has been done trying to shield it from invalidations but it seems to be a never ending battle. During the loading of OmniPackage.jl for examples, I have seen code loading gotten recompiled 4 times during the loading of that package.A possible solution is to run the code loading code in a fixed world age thereby making it immune to invalidations (since it keeps running the old code). This also means that the code cannot be straight forwardly Revised, but maybe that is a price worth paying.
cc @c42f, @timholy, @JeffBezanson, @vtjnash