-
-
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
reinit Main by clearing everything in it after building the sysimg #5746
Conversation
Today I gave a demonstration to my lab of some Julia code I've been writing; overall it went well, but everyone was surprised that it took 52 seconds just to load the code before I could start the demo (and then slow performance for the next ~15 seconds while various bits got compiled). Such slow startup times don't help debugging, either. I'd love to vouch for this PR, but it's out of my league (heck, I don't even understand why the scheduler was related to precompiled packages). Anyone else feel up to it? |
The issue was that things had to happen in this order:
In order to precompile packages, one wants to move 2 after 4 but 2 had to come before 3 and 4 had to come after 3. The solution was to remove 3 altogether, allowing 2 and 4 to be arbitrarily ordered. |
I think the only person who can evaluate this is Jeff. Unfortunately, he can be a hard man to contact. |
Well, I know he's been working hard on scheduler-related issues, and perhaps the dust hasn't even settled from that yet. I may be able to chip away at those load times a bit by some code-partitioning. @StefanKarpinski, thanks for the explanation. |
Rather than packing everything into the julia binary, is it at all practical to go with a more modular approach: have |
That is much much harder. You can pack stuff in now -- just need a base sys0.ji image to build from which doesn't have the extra stuff |
Good point, I'll do that locally. |
I don't think mutating the module is a good way to do this. We probably want to do what we're doing with |
|
|
@StefanKarpinski I was scrolling down to write that suggestion, only to see that another great mind had already thought alike. ;) |
Nice use of ! In the method name, Stefan I tried that first Jeff, but ran into a lot of problems since it requires changing the binding of almost everything so that Base and Core gets reparented in the new Main. |
How about |
There's something hilarious about providing this functionality but making people type unicode to use it. |
I didn't think the parent module of |
It wasn't likely the Core module itself that caused issues. And I'm not saying it is completely impossible, but it seemed more fragile that way, so I switched approaches. Perhaps it was just that I tried to also replace Core, but it seemed that the Perhaps instead we could architect: module Main
module Core end
module Base end
module This_Is_All_New
module Main
module Core end
module Base end
module MoreNewStuff_WhichCantSeeMain end
end
end
end
Main = Main.This_Is_All_New |
I'm not sure what "pretending not to move" means. I was thinking
|
I'm not sure what |
I don't think we can eliminate the 2-stage bootstrap; it could have bad performance implications. |
Superseded by #5821 |
Thanks |
Continuing the discussion started in #5687.
We can't compile the sysimg twice because of old crap left in the Main module. This implements a
empty!(::Module)
functionality so that Main is left in an almost pristine state after redefining Base.