Python Pycharm调试器比正常运行慢得多

Python Pycharm调试器比正常运行慢得多,python,performance,debugging,ironpython,pycharm,Python,Performance,Debugging,Ironpython,Pycharm,我试图使用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 =

我试图使用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
Pystone(1.1) time for 50000 passes = 0.462739
This machine benchmarks at 108052 pystones/second
pydev debugger: starting
Pystone(1.1) time for 50000 passes = 4.49224
This machine benchmarks at 11130.3 pystones/second
调试器:

"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
Pystone(1.1) time for 50000 passes = 0.462739
This machine benchmarks at 108052 pystones/second
pydev debugger: starting
Pystone(1.1) time for 50000 passes = 4.49224
This machine benchmarks at 11130.3 pystones/second

有人知道这里发生了什么吗?

问题是ironpython。显然,ipy不能很好地与调试器配合使用。我再次使用相同的调试器(EclipsePydev、pycharm、VisualStudio)运行pystone,但这次使用的是常规python发行版而不是ironpython。结果要好得多:

使用标准python正常运行:

"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
Pystone(1.1) time for 50000 passes = 0.462739
This machine benchmarks at 108052 pystones/second
pydev debugger: starting
Pystone(1.1) time for 50000 passes = 4.49224
This machine benchmarks at 11130.3 pystones/second
使用标准python调试运行:

"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
Pystone(1.1) time for 50000 passes = 0.462739
This machine benchmarks at 108052 pystones/second
pydev debugger: starting
Pystone(1.1) time for 50000 passes = 4.49224
This machine benchmarks at 11130.3 pystones/second

因此,在调试模式下,常规python似乎仍然会经历显著的减速,但与ironpython所经历的减速相比,这并没有什么不同。如果你遇到这个问题,你可以考虑扔掉Ion Python。< /P>我给了PyDev一个机会。它的性能稍微好一点,但运行和调试之间的差距大致相同。但是ipy发行版运行更快,所以在CPython中调试,在ipyGood point中运行。但在某些情况下,我认为这是不可能的。Ironpython的存在主要是为了访问.net库。CPython不会有它们,因此无法调试实现.net的ipy程序。