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

**URL:** <https://discourse.julialang.org/t/vs-code-custom-sysimage-startup-time-for-run-in-repl-and-run-as-new-process/82115>\
**Category:** VS Code\
**Tags:** question, sysimage\
**Created:** [June 2, 2022, 8:53am UTC](https://discourse.julialang.org/t/vs-code-custom-sysimage-startup-time-for-run-in-repl-and-run-as-new-process/82115 "2022-06-02T08:53:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nabajour](https://avatars.discourse-cdn.com/v4/letter/n/45deac/32.png) [@nabajour](https://discourse.julialang.org/u/nabajour)\
**Post date:** [June 2, 2022, 8:53am UTC](https://discourse.julialang.org/t/vs-code-custom-sysimage-startup-time-for-run-in-repl-and-run-as-new-process/82115/1 "2022-06-02T08:53:56Z")

</div>

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:

```julia
$ 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

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [June 2, 2022, 8:59am UTC](https://discourse.julialang.org/t/vs-code-custom-sysimage-startup-time-for-run-in-repl-and-run-as-new-process/82115/2 "2022-06-02T08:59:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [June 2, 2022, 9:22am UTC](https://discourse.julialang.org/t/vs-code-custom-sysimage-startup-time-for-run-in-repl-and-run-as-new-process/82115/3 "2022-06-02T09:22:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![nabajour](https://avatars.discourse-cdn.com/v4/letter/n/45deac/32.png) [@nabajour](https://discourse.julialang.org/u/nabajour)\
**Post date:** [June 2, 2022, 9:47am UTC](https://discourse.julialang.org/t/vs-code-custom-sysimage-startup-time-for-run-in-repl-and-run-as-new-process/82115/4 "2022-06-02T09:47:03Z")

</div>

> 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

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [June 2, 2022, 9:49am UTC](https://discourse.julialang.org/t/vs-code-custom-sysimage-startup-time-for-run-in-repl-and-run-as-new-process/82115/5 "2022-06-02T09:49:11Z")

</div>

> [@nabajour](#):
>
> ~6s in a project without CustomSysimage

Yeah, that looks reasonable.

> [@nabajour](#):
>
> I’ll enter a bug in the julia-vscode github

Thanks!
