-
-
Notifications
You must be signed in to change notification settings - Fork 416
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
Add precompile statements to reduce startup latency #1074
Comments
Maybe just copy https://github.com/JuliaLang/IJulia.jl/blob/cc2a9bf61a2515596b177339f9a3514de8c38573/src/kernel.jl but comment out the final I guess you could also add an environment variable or something to You may have to undo the IO redirects at the end, i.e. redirect_stdout(IJulia.orig_stdout[])
redirect_stderr(IJulia.orig_stderr[])
redirect_stdin(IJulia.orig_stdin[]) Potentially you could also manually call execute_request(requests[], Msg(String[], Dict(), Dict(["code"=>"nothing\n", "silent"=>true, "user_expressions"=>[]]))) |
I've been trying to get that to work but so far have not had any success. lots of those functions simply error if run during precompilation, and what I am able to keep without errors don't seem to have any effect on the time to start for a kernel. |
I also would like to improve the TTFX. Some random thoughts (as someone who only recently started looking at the code):
@MasonProtter, would you by any chance have time to look into some of these things with me? I will try to find some time for it over the next few weeks/months. |
Yes I would be interested in collaborating on this! |
So @timholy and I have done a little preliminary looking into adding
precompile
statements to reduce the latency of IJulia kernels, and it seems to us that a major problem is that there's no clear way to run a PrecompileTools.jl or SnoopCompile.jl workflow to actually get the relevant precompile statements from a running notebook, so we're forced to resort to--trace-compile
kernels.@stevengj do you have any insight into how we might be able to set up a PrecompileTools.jl workflow that starts up and spins down a kernel during precompilation?
The text was updated successfully, but these errors were encountered: