# 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:** 1\
**Showing post:** 43

<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.)

---

_[View the full topic](https://discourse.julialang.org/t/extremely-slow-debugging-in-vs-code/124762)._
