Pycharm debugger much slower than normal run
Asked Answered
W

1

7

I am trying to use pycharm in order to debug an ironpython script. It is going poorly because pycharm is running very slowly in debug mode. I realize that we can expect some slowdown, but I am experiencing a slowdown of roughly 200x. Below are my pystone results:

Normal run:

"C:\Program Files (x86)\IronPython 2.7\ipy.exe" C:/Users/melchoir55/PycharmProjects/pystone/pystone.py
Pystone(1.1) time for 50000 passes = 0.270744
This machine benchmarks at 184676 pystones/second

Debugger:

"C:\Program Files (x86)\IronPython 2.7\ipy.exe" -X:Frames "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 3.0.1\helpers\pydev\pydevd.py" --multiproc --client 127.0.0.1 --port 52669 --file C:/Users/melchoir55/PycharmProjects/pystone/pystone.py
pydev debugger: warning: sys._current_frames is not supported in Python 2.4, it is recommended to install threadframe module
pydev debugger: warning: See http://majid.info/blog/threadframe-multithreaded-stack-frame-extraction-for-python/
pydev debugger: process 9064 is connecting

Connected to pydev debugger (build 131.339)
Pystone(1.1) time for 50000 passes = 71.5615
This machine benchmarks at 698.700 pystones/second

Anyone have any idea what might be going on here?

Wounded answered 1/11, 2013 at 20:54 Comment(1)
I gave PyDev a shot. It performed slightly better, but the disparity between run and debug is about the same.Wounded
W
6

The problem was ironpython. Apparently, ipy doesn't work well with debuggers. I ran pystone again using the same debuggers(eclipse pydev, pycharm, visual studio) except this time using a regular python distribution instead of ironpython. The results were much better:

Normal run with standard python:

Pystone(1.1) time for 50000 passes = 0.462739
This machine benchmarks at 108052 pystones/second

Debug run with standard python:

pydev debugger: starting
Pystone(1.1) time for 50000 passes = 4.49224
This machine benchmarks at 11130.3 pystones/second

So it appears regular python still experiences a significant slowdown in debug mode, but nothing compared to the slowdown experienced by ironpython. If you experience this problem, you might consider dumping ironpython.

Wounded answered 5/11, 2013 at 20:32 Comment(2)
However the ipy release run was faster so debug in CPython and run in ipySoppy
Good point. Under some circumstances though, I would think this would be impossible. Ironpython mostly exists to give access to .net libraries. CPython wouldn't have them, and so one wouldn't be able to debug an ipy program implementing .net.Wounded

© 2022 - 2024 — McMap. All rights reserved.