我正在尝试使用pycharm来调试ironpython脚本。它很糟糕,因为pycharm在调试模式下运行得非常慢。我意识到我们可以预期会有一些放缓,但我正在经历大约200倍的放缓。以下是我的pystone结果:
正常运行:
"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
任何人都知道这里会发生什么?
答案 0 :(得分:6)
问题是铁箍。显然,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。