# Extremely slow debugging in VS Code

**URL:** <https://discourse.julialang.org/t/extremely-slow-debugging-in-vs-code/124762>\
**Category:** New to Julia\
**Tags:** question, debugging, vscode\
**Created:** [January 14, 2025, 1:18pm UTC](https://discourse.julialang.org/t/extremely-slow-debugging-in-vs-code/124762 "2025-01-14T13:18:14Z")\
**Posts on this page:** 14\
**Page:** 3

<div class="post-metadata">

**Author:** ![p\_f](https://avatars.discourse-cdn.com/v4/letter/p/45deac/32.png) [@p\_f](https://discourse.julialang.org/u/p_f)\
**Post date:** [January 15, 2025, 4:59pm UTC](https://discourse.julialang.org/t/extremely-slow-debugging-in-vs-code/124762/41 "2025-01-15T16:59:35Z")

</div>

Yeah, it’s a bit weird haha. You can also add specific functions, e.g. adding “-testpkg.f2”, so you don’t have to treat the entire module as interpreted. edit: upon further testing, this doesn’t seem to work as expected…

I’m also sometimes facing an issue that breakpoints persist after removing them. But if you remove them by unticking the breakpoint here:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/0/d/0d4dde98e157de5c345e25db2ab65a80946796ac.png)  
then it seems to respect removing the breakpoint.

---

<div class="post-metadata">

**Author:** ![MathMan](https://avatars.discourse-cdn.com/v4/letter/m/8491ac/32.png) [@MathMan](https://discourse.julialang.org/u/MathMan)\
**Post date:** [January 15, 2025, 8:02pm UTC](https://discourse.julialang.org/t/extremely-slow-debugging-in-vs-code/124762/42 "2025-01-15T20:02:03Z")

</div>

This runs so much faster in your example. For me it does not work. Still extremely slow. I added ALL\_MODULES\_EXCEPT\_MAIN and did “Apply default compiled modules/functions”.

How is it even possible that it differs from user to user? I am using a very powerful pc that blasts through other applications easily…

Each time I click on Run Debug (F5) I can go get a coffee until it even stops at a debug point placed in the first line.

---

<div class="post-metadata">

**Author:** ![Nathan\_Boyer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nathan_boyer/32/14825_2.png) [@Nathan\_Boyer](https://discourse.julialang.org/u/Nathan_Boyer)\
**Post date:** [January 15, 2025, 8:17pm UTC](https://discourse.julialang.org/t/extremely-slow-debugging-in-vs-code/124762/43 "2025-01-15T20:17:15Z")

</div>

> [@MathMan](#):
>
> Each time I click on Run Debug (F5)

> [@p\_f](#):
>
> Also note I’m using `@enter` to debug a function, so I’ve put your code into a function.

When run as a script, you are working with [global variables](https://docs.julialang.org/en/v1/manual/performance-tips/#Avoid-untyped-global-variables) which will be slower. If you put the bulk of your computation inside a function (like p\_f did), so you are instead working with [local variables](https://docs.julialang.org/en/v1/manual/variables-and-scoping/#local-scope), you should see a speed improvement.

Note that to debug after doing this you will either click “Run Debug” on a file which contains the line `myplottingfunc()` or type `@enter myplottingfunc()` into the REPL. (You start debugging at the call site not at the function definition.)

---

<div class="post-metadata">

**Author:** ![eweiss](https://avatars.discourse-cdn.com/v4/letter/e/b487fb/32.png) [@eweiss](https://discourse.julialang.org/u/eweiss)\
**Post date:** [January 19, 2025, 3:11pm UTC](https://discourse.julialang.org/t/extremely-slow-debugging-in-vs-code/124762/44 "2025-01-19T15:11:16Z")

</div>

I remember using Borland’s languages complete with IDE and debugger to code C/C++, Pascal, and Delphi which compiled to exe files. I could set a break point by clicking on a line in the editor and see the values of variables that I’d selected or add some to monitor. I could even set conditional breakpoints. There was little need to create a subset of data to keep the compiler/debugger working at an acceptable speed.

---

<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:** [January 19, 2025, 4:14pm UTC](https://discourse.julialang.org/t/extremely-slow-debugging-in-vs-code/124762/45 "2025-01-19T16:14:29Z")

</div>

> [@eweiss](#):
>
> Borland’s languages complete with IDE and debugger

Yes, that was nice, but they are also [prohibitive expensive](https://www.embarcadero.com/app-development-tools-store/delphi). Writing good debuggers is something difficult to find open source programmers for who do it in their spare time.

---

<div class="post-metadata">

**Author:** ![joa-quim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joa-quim/32/227_2.png) [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Post date:** [January 19, 2025, 6:09pm UTC](https://discourse.julialang.org/t/extremely-slow-debugging-in-vs-code/124762/46 "2025-01-19T18:09:14Z")

</div>

> [@ufechner7](#):
>
> Yes, that was nice, but they are also [prohibitive expensive](https://www.embarcadero.com/app-development-tools-store/delphi)

Visual Studio is free and does just that. But apparently, the Julia internals make it difficult to create efficient debuggers.

---

<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:** [January 19, 2025, 6:44pm UTC](https://discourse.julialang.org/t/extremely-slow-debugging-in-vs-code/124762/47 "2025-01-19T18:44:10Z")

</div>

> [@joa-quim](#):
>
> Visual Studio is free and does just that.

Not true. Visual studio code provides a framework for an IDE, it does not provide any debugger. You still need a language specific debugger, and a plugin that provides a GUI for this language specific debugger. These have been written for old languages like C++ by companies with big pockets, but not so much time and money was yet invested into the Julia specific components yet.

By the way, [Visual Studio](https://visualstudio.microsoft.com/vs/pricing/?tab=paid-subscriptions) is not free at all.

---

<div class="post-metadata">

**Author:** ![joa-quim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joa-quim/32/227_2.png) [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Post date:** [January 19, 2025, 6:47pm UTC](https://discourse.julialang.org/t/extremely-slow-debugging-in-vs-code/124762/48 "2025-01-19T18:47:14Z")

</div>

Yes, it is free. I use it a lot.

> **[Visual Studio 2022 Community Edition – Download Latest Free Version](https://visualstudio.microsoft.com/vs/community/)**
>
> Try our free, fully-featured, and extensible IDE for creating modern developer apps for Windows, Android, & iOS. Download Community for free today!

---

<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:** [January 19, 2025, 6:49pm UTC](https://discourse.julialang.org/t/extremely-slow-debugging-in-vs-code/124762/49 "2025-01-19T18:49:31Z")

</div>

Free for non-commercial use ≠ Free  
99 EUR per month for the cheapest license, still cheaper than Borland Delphi, which starts at 2000 EUR for one year, in both cases comparing the professional license.

The VS code license says:  
An unlimited number of users within an organization can use Visual Studio Community for the following scenarios: in a classroom learning environment, for academic research, or for contributing to open source projects.

---

<div class="post-metadata">

**Author:** ![joa-quim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joa-quim/32/227_2.png) [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Post date:** [January 19, 2025, 6:58pm UTC](https://discourse.julialang.org/t/extremely-slow-debugging-in-vs-code/124762/50 "2025-01-19T18:58:08Z")

</div>

OK, if that makes you happy.

---

<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:** [January 19, 2025, 7:02pm UTC](https://discourse.julialang.org/t/extremely-slow-debugging-in-vs-code/124762/51 "2025-01-19T19:02:24Z")

</div>

Yes, I find it import that people understand that someone has to invest time and effort in creating a good IDE or IDE plugin and a good debugger. If we find 500 people who want to pay 1000 EUR for a good Julia debugger with good IDE integration I would try to make it happen. If not I try to contribute to the open source development in my spare time.

---

<div class="post-metadata">

**Author:** ![Benny](https://avatars.discourse-cdn.com/v4/letter/b/49beb7/32.png) [@Benny](https://discourse.julialang.org/u/Benny)\
**Post date:** [January 19, 2025, 8:58pm UTC](https://discourse.julialang.org/t/extremely-slow-debugging-in-vs-code/124762/52 "2025-01-19T20:58:31Z")

</div>

> [@eweiss](#):
>
> There was little need to create a subset of data to keep the compiler/debugger working at an acceptable speed.

Language semantics and usage allowed functions to be compiled in advance, albeit bogged down by debug information. Even with metaprogramming and generics, if you’re debugging an executable then you have the guarantee that you compiled whatever you needed. Like other interactive languages, Julia lacks those nice guarantees and relies on skipping over optimized compiled code to offset the performance hits of interpretation.

It’s also worth pointing out Julia’s relative youth. Prior to v1 stabilizing the language, developing a debugger would be a temporary experiment at best. By that time, MATLAB’s debugger was already mature, and that’s coming from someone who had many gripes with it.

> [@joa-quim](#):
>
> Yes, it is free. I use it a lot.

> [@ufechner7](#):
>
> Free for non-commercial use ≠ Free

It can be equally true for a debugger to be easily accessible AND its developers be backed by a business, I think we can agree to agree on the facts, if not semantics.

---

<div class="post-metadata">

**Author:** ![Maucejo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maucejo/32/39090_2.png) [@Maucejo](https://discourse.julialang.org/u/Maucejo)\
**Post date:** [January 20, 2025, 8:03am UTC](https://discourse.julialang.org/t/extremely-slow-debugging-in-vs-code/124762/53 "2025-01-20T08:03:31Z")

</div>

I have to admit that using the VSCode UI to launch the debugger is slow. However, when I use `@enter function_to_debug(params)`, the debugger is very usable and sufficiently fast. I have sometimes to play with compiled modules but very rarely. I don’t know if it’s related to my workflow.

---

<div class="post-metadata">

**Author:** ![eweiss](https://avatars.discourse-cdn.com/v4/letter/e/b487fb/32.png) [@eweiss](https://discourse.julialang.org/u/eweiss)\
**Post date:** [January 20, 2025, 4:30pm UTC](https://discourse.julialang.org/t/extremely-slow-debugging-in-vs-code/124762/54 "2025-01-20T16:30:12Z")

</div>

At some point, Borland started selling “Borland” versions of full featured compilers with IDE, GUI, etc. and “Turbo” that were less expensive and missing some of the features like a GUI designer. The Turbo versions, and in the earlier days the Borland versions, were very inexpensive because Borland had to compete with Microsoft. I bought Version 1.0 of Turbo Pascal for something like $19 or $39 dollars which I used to write statistical software that I sold in Byte and the Journal of the American Statistical Association.

When saw the first ad for Turbo Pascal, I called Borland and asked how they could make all these claims of doing a better job than Microsoft. I talked with Philippe Kahn, which shows how small they started. He said, “we know how to write compilers.”

[Previous page](https://discourse.julialang.org/t/extremely-slow-debugging-in-vs-code/124762.md?page=2)
