Why is debugging in eclipse/pydev so slow for my python program?

前端 未结 2 1408
臣服心动
臣服心动 2021-01-02 13:58

I have a relatively simple (no classes) python 2.7 program. The first thing the program does is read an sqlite dbase into a dictionary. The database is large, but not huge,

相关标签:
2条回答
  • 2021-01-02 14:33

    I simply commented this line out:

    np.set_printoptions(threshold = 'nan')
    

    It seems eclipse is trying to keep up with too much information.

    0 讨论(0)
  • 2021-01-02 14:41

    Here is a good enough workaround, based on Mikko Ohtamaa's hint. I just verified the following on my Mac Air:

    • If I simply close the 'Variables' window in the Eclipse GUI, I can single step through the code at normal speed. Which is great, but, uh, I don't have the Variables window.
    • For any variable I want to see, I can hover my cursor over the variable and see the value. I didn't attempt to hover over my large dictionary that is the culprit here.
    • I can also right-click on any variable and add a 'Watch', which brings up an 'Expressions' window. In this case the variable is just a degenerate case (very simple case) of an 'expression.

    So, the workaround for me is to close the Eclipse Variable window, and use the Expressions window to selectively view variables. A pain, but for the debugging I'm doing it is better than pdb.

    0 讨论(0)
提交回复
热议问题