Julia debugging is extremely slow

If the OP wants to seriously compare debuggers, then Julia is not a fair match against Python, because Python is an interpreted language and debuggers are almost “native” to that execution model. You also cannot compare Julia to C or Fortran, because those are AOT languages with decades of mature tooling and well-established debug information pipelines.

So I took a look at how other JIT language like the JVM/Java (HotSpot) and the JavaScript V8 engine manage to deliver a smooth debugging experience.

What HotSpot and V8 get right

They make debugging a runtime feature, not a bolt-on. In practice that means:

  • Deoptimization on demand: when you hit a breakpoint/step, the runtime can back out of aggressive optimizations (e.g., inlining) so source-level stepping still makes sense.

  • Tiered execution: they can drop from optimized JIT code to a more debug-friendly tier when precision matters.

  • Rich metadata + safepoints: the runtime keeps enough mapping info to reconstruct call stacks and variables reliably.

None of this came for free: these capabilities are the result of decades of sustained industrial effort in runtimes, compilers, and tooling.

Why Julia feels harder in practice

Julia’s performance model leans heavily on aggressive specialization and LLVM optimizations. That’s great for speed, but it makes “stable source views” harder (especially across inlining and invalidation).

Even today, Julia’s mainstream source-level debugging still relies on interpreter-based execution (via JuliaInterpreter). As pfitzseb notes in post #33, a mixed compiled/interpreted setup mainly improves performance by minimizing how much code is interpreted; it’s essentially a workaround rather than a full replacement for interpretation.

Summary

It’s only natural that debuggers feel great in Python and in AOT languages: the execution model makes the tooling almost inevitable. But a first-class debugger is by no means unprecedented in the JIT world. When we look at HotSpot and V8 delivering genuinely smooth debugging through deoptimization, tiering, on-stack replacement, and carefully maintained metadata, it becomes hard to escape a simple conclusion: Julia has not yet made building that level of runtime debugging machinery a top priority.

@tue: I was inspired by your post (thanks again), so the JetBrains plugin now supports hot-swapping during debugging. This allows you to modify the variables and functions during a paused debugger session. I would love if you could give it another go sometimes and let me know what you think (happy to send you over a voucher code for a free month or so so you can do it proper - if anyone else is interested, send me a dm, too)

The update is now rolling out as we speak and should be available to all within 24hrs or so.

I will happily test it out and give some feedback if you send me a voucher such that I can :slight_smile:
I will send you a direct message with details.