Thursday, January 14, 2016

PyDev 4.5.1: debug faster

PyDev 4.5.1 brings niceties such as an improvement on the code-completion so that properties declared with @property no longer show arguments parenthesis and Ctrl+1 can be used inside a bracketed statement to wrap/unwrap its contents over multiple lines (thanks to yohell). Also, the refactoring, parsing and search had some fixes, but the major changes were in the debugger.

The debugger is much faster and has optional Cython modules for even additional speedups.

In short, the debugger is overall 40% faster without Cython and 138% faster with Cython in the benchmarks created -- although in real world cases I expect even better gains as the benchmarks were done for the cases where the debugger has more overhead than usual.

Graphs with more details on the improvements may be seen at:

https://www.speedtin.com/reports/7_pydevd_cython (performance results with cython).

https://www.speedtin.com/reports/8_pydevd_pure_python (performance results without cython).

Also, the debugger backend is now also available through "pip install pydevd" (https://pypi.python.org/pypi/pydevd), so, it's easier to setup the remote debugging in a different machine (note that users shouldn't need to install the debugger, only if doing a remote debugging session).

As a note, I'd like to thank JetBrains, which helped on sponsoring the performance improvements in the PyDev Debugger (as it's also the debugger backend used by PyCharm).

For LiClipse users, 2.5.1 (just released too) includes the latest PyDev.

8 comments:

  1. This sounds great but I'm a bit confused by the CPython reference (I am aware of what it though I have not used it). Should we install Cypython and then automagically get 138% or what are steps please? Would love to get such a speedup on debug!
    Or maybe you mean only if our own code is in CPython?

    ReplyDelete
  2. It's not CPython reference but "Cython": http://cython.org (so, the debugger has a speedup module compiled with Cython to speed up the debugger) -- so, you don't have to do anything on your own code except compile the cython code (if you're on Linux/Mac OS -- for Windows pre-compiled modules are provided for Python 2.7, 3.4 and 3.5) -- a warning with the step you have to take is printed on screen if you have to take any steps.

    ReplyDelete
  3. Doh, yes Cython.
    I did "pip install cython". Which worked. Do I need to do more? I am on python 2.7
    Thanks for any further guidance.

    ReplyDelete
  4. I am on windows (noticed your pre-compiled modules reference.. but still not quite sure what to do :-( )
    One of your backers too BTW :-)

    ReplyDelete
  5. You don't need to do anything if you're on windows with python 2.7, 3.4 or 3.5 (the speedups are already provided and the debugger will use them automatically).

    ReplyDelete
  6. Thanks! Really appreciated

    ReplyDelete
  7. Does the improved debugger perform any faster than the baseline under PyPy?

    ReplyDelete
  8. Yes, although I haven't profiled it, as the regular python version is faster, PyPy should also be faster even without the cython speedups.

    ReplyDelete