#635 Python Profiler

open
nobody
None
5
2008-02-12
2008-01-25
No

First version of the python profiler...

Discussion

  • Thomas Trummer

    Thomas Trummer - 2008-01-25
     
  • Thomas Trummer

    Thomas Trummer - 2008-01-25

    Logged In: YES
    user_id=62194
    Originator: YES

    File Added: python_profiler.png

     
  • Fabio Zadrozny

    Fabio Zadrozny - 2008-01-26
    • status: open --> pending
     
  • Fabio Zadrozny

    Fabio Zadrozny - 2008-01-26

    Logged In: YES
    user_id=617340
    Originator: NO

    Hi,

    I took a look at the patch and it seems good...

    Now, I have some suggestions that I think should be at least discussed before the patch is applied:
    1. cProfile is available for python 2.5 and should be used instead of the regular profile module (it's much faster)... so, maybe a preferences for that should be available (with cProfile being the prefered one -- users that don't have it can use profile instead).

    2. It would be nice for the user to select any file to see in the profile view (and not only the default location), and probably also choosing the output file for that run -- making the refresh could even be a separate step (does not need to be automatic). This is particularly useful for profiling because usually you have several runs you want to compare, so, at least the user could open each file to check it (I have a decorator I use for profiling which generates those files, so, it would be really nice to have that view open that file instead of having to run the whole session in profile mode -- which could be unfeasible on big projects)

    3. I think the names of the times could be a bit more intuitive... e.g.: 'cumulative' / 'in function' or something like that... what do you think? (the usual in the profile module are cumtime / tottime / percall, so, the names could probably be closer to that)

    4. When loading the data, some sort of process dialog would be nice (again, this can get slow on real cases)

     
  • Fabio Zadrozny

    Fabio Zadrozny - 2008-01-27

    Logged In: YES
    user_id=617340
    Originator: NO

    Oh, just wanted to add 2 more things:

    1. a limit on the number of entries could be available (and then you could use the 'pstats' python module to gather statistics instead of having to get them all in java to manipulate it -- so, python would be the backend doing those computations, as passing all that data to java for the computations can be expensive -- and you usually only want to see the 20-50 most expensive calls ordered by cumulative or tottime)

    2. Just wanted to add that I think it's a really nice patch and as soon as those things get sorted out it'll be something really nice to add to pydev :)

     
  • Thomas Trummer

    Thomas Trummer - 2008-01-27

    Logged In: YES
    user_id=62194
    Originator: YES

    1) Well, in theory it should use the correct profiler based on the selection made while creating the project (Python 2.3, Python 2.4, Python 2.5, Jython) but I wasn't sure if that option really has any effect. So I choose the safe default. (The Jython version of the profiler is broken at the moment.)

    2) Comparing the results of different profile runs and per file statistics are planned for the next version. I can see the value in the decorator approach but I'm not sure this can be implemented UI-wise in a sound way.

    3) I actually don't really care but I find my names intuitive (might be because inclusive and exclusive are almost native in my language). At least they are short enough to be readable as column headers.

    4) Actually there is one in the lower right of the screen per default (you can a add a Sleep to the read-job to see it).

    1) Filtering is planned. Visual Studio filters everything under 3% inclusive, works quit nice. For the data I would prefer having everything on the Eclipse side. Might come in handy for a possible call-graph view.

    2) Glad you like it… :)

     
  • Thomas Trummer

    Thomas Trummer - 2008-01-27
    • status: pending --> open
     
  • Thomas Trummer

    Thomas Trummer - 2008-01-28
    • status: open --> pending
     
  • SourceForge Robot

    Logged In: YES
    user_id=1312539
    Originator: NO

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

     
  • SourceForge Robot

    • status: pending --> closed
     
  • Fabio Zadrozny

    Fabio Zadrozny - 2008-02-12

    Logged In: YES
    user_id=617340
    Originator: NO

    Leaving in open state.

     
  • Fabio Zadrozny

    Fabio Zadrozny - 2008-02-12
    • status: closed --> open
     
  • Anonymous - 2010-06-30

    Any news about this feature? I would really appreciate if the profiler was integrated into PyDev...