ipython/ipython — Issue #1317: Very slow traceback construction from Cython extension
Author: wesm
Created: 2012-01-24 21:50:07+00:00
State: open

I think this is the fault of IPython and I'm having a hard time coming up with a self-contained example, but basically I'm noticing a major lag between statement execution and IPython coming back with the formatted traceback when the exception is generated in Cython code. For example, with pandas git master (99e2eec, because I'm about to fix this bug), the following code takes about 8.5 seconds to play out:

```
from pandas import Series
s = Series({'T1': 5})
print s.groupby({'T1': 'T2'}).agg(sum)
```

Running this code

```
start = time.time()
print s.groupby({'T1': 'T2'}).agg(sum)
time.time() - start
```

gives me

```
In [10]: time.time() - start
Out[10]: 8.473900079727173
```

By contrast, running the same code in the standard Python interpreter gives the stack trace virtually instantaneously.

Any ideas what's wrong? This same problem seems to be present in IPython git master, 0.12, and 0.11.