Skip to content

Python Debugging is too slow. #1634

Closed
Closed

Description

@jeanne150

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

Activity

  1. jeanne150 commented on Jul 22, 2024

    @jeanne150
    Author

    Related on StackOverflow:here

  2. rchiodo commented on Jul 22, 2024

    @rchiodo
    Contributor

    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

  3. locked and limited conversation to collaborators on Jul 22, 2024
  4. converted this issue into a discussion #1635 on Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions