-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Feature request: Save state of a Julia session #22598
Comments
Maybe JLD(https://github.com/JuliaIO/JLD.jl) can do the trick? |
I don't think so , I am talking about saving the binary state of the session including loaded modules |
Why are you terminating a session if you just want to reconstitute the same session again? Why not just continue in that case? Some form of persistent compilation caching would have the same effect without being tied to session state in the same way. This seems to be an overly specific feature request – what's actually wanted is a reduction in compilation delays. This could be one way to do that, but there's not much reason to believe it's the only or best way. |
When in development mode, I don't want to "reconstitute the same session again" , I just want to My base script that only initialize things and reads data takes 60 seconds to load the first time and only a second after that. This Feature request would solve that. Although it takes only a second to load when warm, it takes 60 second for the users of my Application
I agree completely, I just think that saving the state is easier and more achievable in the short-run When I first encountered Julia I was under the impression that this feature is already baked into the language
But could never managed to get it to work. And from philosophical point of view it pains me to see everything re-compiles again and again |
Thanks for the context and explanation – that does help understand your needs here (which I'm sure are not unique). I've often wanted the ability to snapshot a running program and be able to restart the snapshot – multi-shot continuations but for programs, if you will – but it seems to be technically nearly impossible to do this because of the large amount of program state which cannot be persisted or restored across processes. |
I suppose the majority of the time is spent compiling to binary, you could I presume cache that to speed things up. |
A bit off-topic, but Revise.jl helps a lot with what you describe here: https://discourse.julialang.org/t/ann-higher-productivity-fewer-julia-restarts-with-revise-jl/4564 |
Perhaps a more limited use-case is achievable: I often find myself having to reboot my (corporate managed) machine, for a host of reasons {mandatory security patch, wifi networking keeps dropping, finally figured out how to kill mac animations, etc.}. I'm often halfway through something interesting in julia REPL, and I can't tie it all up before having to restart. It would be convenient to save the imported packages, function and variable definitions, all the things I will have to reload after my machine reboots. I'm not concerned about jit compilation or speed, just avoiding a bunch of copy paste into REPL on restart. |
Perhaps there is a user-level answer to this? Like, writing a macro that creates a stub function which is able to change which function is called from the moment where you declare that you want to make a snapshot. Probably involving global state for tracking them and atomic locks to update them, for instance. You might then mark any function you want controlled this way with the macro-call. |
[Added more detail to previous comment.] |
This seems better to be discussed on Discourse. |
The ability to save the state of a Repl'd Julia session , and to resume it in a later date.
This feature coupled with the "Reloadable Modules" feature and the cycler mode in Juno will save copious amounts of "the first call is slow" time.
The text was updated successfully, but these errors were encountered: