6

ironpython スクリプトをデバッグするために pycharm を使用しようとしています。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

ここで何が起こっているのか誰にも分かりますか?

4

1 に答える 1

6

問題はアイアンパイソンでした。どうやら、ipy はデバッガーではうまく動作しません。今回はironpythonの代わりに通常のpythonディストリビューションを使用したことを除いて、同じデバッガー(eclipse pydev、pycharm、visual studio)を使用してpystoneを再度実行しました。結果ははるかに優れていました。

標準の 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 のダンプを検討してください。

于 2013-11-05T20:32:33.133 に答える