You expect code to run with debugging much slower than without. Indeed this is the case and with python, debugging can be sometimes painfully slow.
A relatively recent, low-level feature that was introduces in Python 3.12 is monitoring. Monitoring allows programmers to hook into low level events that occur during the execution of code. This is similar to tracing, which is used by debuggers, but with much greater granularity and control. It turns out that monitoring can help make faster debuggers. Much faster. The next version of PyScripter will include a new debugger that is based on monitoring for python versions 3.12+. Just to give you a taste of the speed-up you get, consider the following code:
import time
def test():
start_time = time.time()
for i in range(1000):
for j in range(1000):
j + i
cost = time.time() - start_time
print("Elapsed time: ", cost)
f(0)
def f(x):
# Set breakpoint here
x *= 2
return x + 1
test()
If you set a break point at the line "f(0)" and start debugging, this is what you get with the PyScripter v5.1.4 and python 3.13.
*** Remote Interpreter Reinitialized ***
Elapsed time: 2.5882363319396973
[Dbg]>>>
There are a million iterations that happen before you reach the breakpoint, so this takes about 2.5 seconds. If you do the same with the forthcoming release of PyScripter you get:
*** Remote Interpreter Reinitialized ***
Elapsed time: 0.016160964965820312
[Dbg]>>>
This is more than x150 speed-up. The code until you reach the breakpoint, runs almost as fast as without debugging. The new debugger shines when you debug over loops or other pieces of code that it is executed repetitively. For other types of code the speedup is not as impressive.
The new release also back-ports some debugging improvements introduced in python 3.14 to python versions 3.10+. So users of these versions will experience faster debugging.