VS code custom Sysimage, startup time for "run in REPL" and "run as new process"

Hi all,

I’m trying to get the startup time of julia down. I created a JuliaSysImage.toml, giving an execution script that exercises frequently used functions I want to precompile. I then ran the build sysimage task.

I can now use it from the shell outside of VS Code. I use the shell “time” function on julia executable and a “@time” on my main function to time execution of the function proper inside the script:

$ time julia --project=. --sysimage JuliaSysimage.so -E "include(\"precompilescript.jl\")"

This starts julia, runs my test and spews out the time it took.

  • with sysimage: shell “time”: 10.5s ( @time macro: 10s)
  • without sysimage: shell “time”: 45s ( @time macro: 27s)
    So it looks like my CustomSysimage works well.

In VS code, with “Execute in REPL” (starting a new REPL):
total time with a stopwatch: about 20s
@time macro: 10s
So it looks like VSCode is using my sysimage, but the REPL startup time is still slow.
Is there a way to get the REPL startup time down? Am I missing something in my sysimage, like Revise, that VS Code would be adding?

If I use “run as a new process”, it seems it’s not using the CustomSysImage, from the timing and from the command line it shows. Can I tell it somewhere in the settings to use it?

Thanks

Just use the normal terminal in vscode and start Julia from the terminal…

A custom sysimg is unlikely to improve REPL startup time in VS Code. I haven’t profiled that in a while, but 10s sounds pretty slow… will look into what’s going on there, if I can repro the issue.

If I use “run as a new process”, it seems it’s not using the CustomSysImage, from the timing and from the command line it shows. Can I tell it somewhere in the settings to use it?

That just sounds like a bug.

A custom sysimg is unlikely to improve REPL startup time in VS Code. I haven’t profiled that in a while, but 10s sounds pretty slow… will look into what’s going on there, if I can repro the issue.

If I “Execute in REPL” a file with println("hello") in my project I get these timings until I’m back at the julia prompt:

  • ~9s in the project with CustomSysimage
  • ~6s in a project without CustomSysimage
    Executing in a new process is instantaneous for both and on the terminal, it takes less than a second. So it looks like some VSCode overhead.

That just sounds like a bug.

I’ll enter a bug in the julia-vscode github

Thanks for the replies

1 Like

Yeah, that looks reasonable.

Thanks!