-
-
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
Make julia + repl start twice as fast [do not merge] #28075
Conversation
9ad3d7e
to
0806301
Compare
0806301
to
8d9bcf6
Compare
Does this also increase response time to first key press? At the moment there is a noticeable lag. |
Yes if I do
it is instant. |
I made a little script that makes this easy to do at home if you build from source: https://gist.github.com/KristofferC/a8a70f4bddafa068d19fd21d40c9015c. Could probably be done similarly to the It contains two version. One that requires two recompilations but manages to catch the whole startup process, and one that only requires one recompilation but misses a bit (loses about 0.1 second startup for me). Would be interesting to hear any results (if it works...) |
I added a commit which did a few actions in the REPL just to see if it passes CI. |
Putting a triage label so we can discuss if we want to try something like this for the release / beta. Personally, I think the performance improvements are definitely worth it. I can take responsibility for it. |
Triage thought this needs to be automated and we should work towards that instead (pretty much exactly #26503). I've tried this a bit before but I didn't know enough about pipes, TTYs etc to be able to record and replay a REPL session. I'll see if I can get some time to work on it but grateful for any help. Getting this working would be very because I do think the impact is quite large. For those who want this now it is quite easy to use the script I posted a few posts up. |
Superseded by #28065? |
If you have checked that the startup and time to prompt is the same as with this PR, then yes. From my testing, that PR didn't do much to either of them. Edit: I tried again and even with a new precompile file on that PR, it didn't seem to affect startup at all, so not sure how that supersedes it. Perhaps you can elaborate @vtjnash? |
I was using this when creating the graphs from #23006 (comment) |
A short animation of starting + restarting julia with this PR and then with the beta: |
Closing in favor of #28118 |
I compiled julia with
#define TRACE_COMPILE
, started./julia 2 > precompile.txt
, copy pasted the output intoprecompile.jl
. Note that anonymous functions are kept. I recorded time to start julia, and also recorded the number of frames (60 FPS) until the banner and prompt showed.Before PR:
After PR
0.6.4
So
time ./julia -e 1+1
is approx 70% faster, and the time until the REPL prompt shows is approx 90% faster with this PR vs master. Also significantly faster vs 0.6.— But won't these anonymous functions go stale quickly?
— Yeah maybe, but let's just have them in for the release then, and then revert the commit or something.
— But won't these anonymous functions be different on different systems?
— Yeah, if different functions are defined on different systems, the precompile list from one system is not directly transferable. Needs something like #26503 to deal with that.
I also have a commit that does the same thing, but in addition, does some moving around in the REPL and it feels awesome to use. But one thing at a time.