spyder: Everything runs slowly after debugger is called

Issue Report Checklist

  • Searched the issues page for similar reports
  • Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • Could not reproduce inside jupyter qtconsole (if console-related)
  • Tried basic troubleshooting (if a bug/error)
    • Restarted Spyder
    • Reset preferences with spyder --reset
    • Reinstalled the latest version of Anaconda
    • Tried the other applicable steps from the Troubleshooting Guide
  • Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

After calling the debugger and pressing “c”, things seem to run slowly in Spyder. Here is a very simple script to show this:

import pdb

x = 0
while True:
    x += 1
    if x % 10000 == 0:
        print(x)
    if x % 1000000 == 0:
        pdb.set_trace()
        # at this point, press "c"

When this script is run, it will count up to 1000000, printing the value of x every 10000 counts, and then call pdb.set_trace() for the first time. This happens fast enough to be almost instaneous on my computer; of course it doesn’t take much time for Python to count to 1000000.

Once you are in pdb, you can press “c” to resume execution, and then you will see the counts of 10000 being printed extremely slowly in comparison. On my computer, it’s about one or two every second.

This also seems to happen if, for instance, you replace the pdb.set_trace() above with pass and set a debugger breakpoint there instead.

Versions

Versions:

  • Spyder 5.4.2
  • Python 3.10.9 64-bit
  • Qt 5.15.6
  • PyQt5 5.15.7
  • Darwin 21.6.0 (macOS Monterey, M1 Max)

Dependencies

I don’t see any “Dependencies” menu entry on Mac. Where is this??

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 16 (14 by maintainers)

Most upvoted comments

Hey guys, I think the situation will be improved in our next version (5.4.4) because we disabled some IPython functionality that was making our debugger quite slow. So, the situation should be similar to what you experienced with Spyder 5.3.3

However, more improvements will come in Spyder 6 about this (that’s why this issue is marked for that version).