我试图使用pycharm调试ironpython脚本。因为pycharm在调试模式下运行得非常慢,所以它运行得很差。我知道我们可能会有一些放缓,但我正在经历大约200倍的放缓。
正常运行:"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
调试器:
"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
有人知道这里会发生什么吗?
最佳答案:
问题是ironpython。显然,ipy不能很好地与调试器一起工作。我再次使用相同的调试器(eclipse pydev、pycharm、visual studio)运行pystone,但这次使用的是常规的python发行版,而不是ironpython。结果好多了:
使用标准python正常运行:Pystone(1.1) time for 50000 passes = 0.462739
This machine benchmarks at 108052 pystones/second
使用标准python调试运行:
pydev debugger: starting
Pystone(1.1) time for 50000 passes = 4.49224
This machine benchmarks at 11130.3 pystones/second
因此,看起来普通的python在调试模式下仍然会经历显著的减速,但是与ironpython经历的减速相比,没有什么明显的减速。如果遇到此问题,可以考虑转储ironpython。