You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When debugging with the same piece of code, the time it takes to run the result with run is 25.895,
and the time it takes to run the result with debug is 205.
import time
from uuid import uuid4
a=[uuid4() for i in range(20000)]
b=a[:19000]+[uuid4() for i in range(1000)]
start=time.time()
c=[i for i in a if i in b]
print(c)
print(time.time()-start)
print("debug point here")
Debugpy is implementing the optimizations that Liran talks about.
3.12 may get better though. The CPython runtime has implemented new tracing mechanisms. Debugpy hasn't really updated to using the new way yet, but it's a work in progress
Activity
jeanne150 commentedon Jul 22, 2024
Related on StackOverflow:here
rchiodo commentedon Jul 22, 2024
Sorry but I don't think there's anything to be done about this. Python debugging is slow based on how it works. You can read more about it here:
https://docs.python.org/3/library/sys.html#sys.settrace
And here:
https://www.youtube.com/watch?v=QU158nGABxI
Debugpy is implementing the optimizations that Liran talks about.
3.12 may get better though. The CPython runtime has implemented new tracing mechanisms. Debugpy hasn't really updated to using the new way yet, but it's a work in progress