Comment 8 for bug 381069

Revision history for this message
Jon Olav Vik (jonovik) wrote : Re: Cannot step debugger in IPython 0.9.1 under Python 2.6.2: Pdb instance has no attribute 'curframe'

#6: So, have you tried installing pydb? If that fails, please post the error message.

#7: On my Windows laptop with the example code below, pydb is about 2.5 times as slow as ipdb, using "%run -d" and "c" (continue, not single-stepping). That's about 170 and 60 times as slow as regular execution (as measured by %timeit), respectively. Example code in file "slow.py":
==
def slow(j):
 L = [0]
 for i in range(j):
  L.append(L[-1] + i)
slow(300000)
==
With pydb, "run -d slow" followed by "c" took about 35.6 s. With ipdb, it took 13.5 s. And %timeit slow(300000) reported 213 ms.

As for "don't be so slow" (with apologies if this is obvious):
* Use breakpoints (perhaps inside ad hoc "if" statements) to avoid single-stepping unproblematic parts of code.
* Use pydb.set_trace()? (Never tried that.)
* Are you using Numpy for the computationally intensive code?
* If you are, Cython (www.cython.org; available for Mac too) might speed up elementwise calculations. (Well, _debugging_ is actually more complicated with compiled code, but perhaps compiling the unproblematic portions would ease your debugging of the rest.)

Hope this helps,
JOV