Painfully slow Julia REPL in VSCode

I started using Julia almost one year ago. I use VSCode (1.75.1) with Julia Language Support (v1.38.2), on Windows 10 Pro.
I must use Julia 1.6.5 (working on a massive project with a large team). In the beginning, everything was fine: the language is terrific and the IDE is excellent: I can run my scripts with “Execute active file in REPL”, I can type commands on the console and also select snippets and execute them by hitting ctrl-ret.
In the last few months Julia REPL started to slow down and now is barely usable. Very often the Julia Language Server hangs, for no understandable reason: ctrl-return does not work anymore (in fact it works, but I have to wait 50-80 seconds for any kind of reaction). Sometimes also the “Execute active file in REPL” command seems disabled. In that case, I quit Visual Studio, waiting for the Julia process to stop and then I start again: I have to wait for the slow startup of the Julia Language Server, but then everything seems to work again for a while. Unfortunately after 10-15 minutes, the problem comes back.
I’ve tried to change the environment, installing only the package I need. This improved the situation for a few days, but after a week the problem started again.

1 Like

A small update.
When the Visual Studio Code Julia REPL hangs, we check the task manager and notice that two Julia processes are running. One of them consumes a lot of CPU. So if we kill that process, the REPL awakes suddenly and for a while everything is fine. Unfortunately, after a few minutes, the problem appears again.

What is that process doing? How do we disable that activity?
Any comment would be appreciated.

I haven’t used the Language Server yet, but it certainly sounds like the culprit.

My understanding is that it’s not the most mature piece of the Julia ecosystem, so it may be struggling with larger projects. More recent versions of Julia have improvements to threading that help with interactive tasks, so that might help when you can upgrade in the future.

I’d suggest disabling the Language Server for now, at least until you can confirm whether it’s the problem. And then maybe open an issue with the developers to see if anything can be done.

Thank you a lot for your answer. If I understand correctly, we cannot “disable the Language Server” if we want to use the Julia console in VSCode. We like the interactivity of Julia’s environment, and it would be a problem to do without it.
We can run the Julia interpreter from the command line and invoke programs using “include(filename)”, but it takes a lot to start (almost a minute to include all our libraries).
I’ll try to write in the julia-VS Code thread…

Have you created an issue on Issues · julia-vscode/julia-vscode · GitHub ?

My guess here is that the language server is trying to index all the symbols in the packages you have loaded and is getting overwhelmed.

Thank you for the answer. I’ll create an issue there.
Your guess is probably correct. Is it possible to disable the indexing somehow?

See option to disable language server indexing? · Issue #1638 · julia-vscode/julia-vscode · GitHub

A comment there suggests changing the VSCode Julia environment to a dummy environment.

Ping @davidanthoff .

We’ve already tried. It worked briefly, but the problem reappeared in the dummy environment.

To be honest this is a critical issue. Its delay my work every day. New versions of julia are caching the compiled information but its far from ideal yet.

What, exactly, is a critical issue? The OP isn’t clear about what the issue was, either.

Not having a fully functional debugger is clearly a critical issue. Is hard to debug julia code. As we mention above, we had advanced in caching and others features, but debug is still a slowly and a painfull task.

  1. I still don’t know exactly what you’re talking about. The debugger works fine for me.
  2. You’re clearly being off-topic, considering that this is the first time the debugger was mentioned here.
1 Like

Im just commenting what was told above in this post. Debugger doesn`t works well for me also because is very slow.

  • Are you using ALL_MODULES_EXCEPT_MAIN ?
  • Are you marking packages that you not debugging to be compiled rather than interpreted?
  • Are you using separate environments for each project?

Please see the example for faster debugging here:
https://www.julia-vscode.org/docs/stable/userguide/debugging/#Example-for-fast(er)-debugging

3 Likes

I’m saying its really very slow to debug. Takes lots of times to load and start. Steping to functions is slow, and also, I’m not doing nothing that you said above because I think this must be transparent as a user. We clearly see thats not done yet. Its a issue we needs solve. Precompiling have enhanced, but its not good yet.

1 Like

I’m not sure you must, I would consider latest version, 1.10. I mean even if your code must work on 1.6, the LTS, I suppose that’s the reasoning.

You must then be careful to not use APIs for 1.7+ (the docs always state if only available for certain version or later) and/or test regularly on 1.6, at least before you 1.10 Julia code in putting in production on 1.6.

I don’t know if using 1.10 will fix “slow Julia REPL”, in VSCode, or elsewhere. Julia 1.6 wasn’t slow for me, just in the REPL, but some actions/“TTFX”, could be, that no longer are.

Note 1.10 will most likely become the new LTS, if not possibly 1.9, so you could also rather use it if you want to know for sure all code will work for the future. The 1.6 LTS is going away, I believe soon, i.e. when we get a new one.

1 Like