Python profiler

Discussion in 'Python' started by Celine & Dave, Oct 3, 2005.

  1. Hello All,

    I am trying to measure memory used in a Python
    program. Also, I would like to gather some statistics
    about object usages. For example, I would like to be
    able to see how much time it takes to search for an
    item in a dict object, how many times it has to access
    the symbol table to retrieve a specific item, and
    things like that. Furthermore, I would like to be able
    to see how a symbol table is created, how many items
    it has, how many times it is accessed during
    execution, etc.

    Python profiler gives timing information about
    functions/methods. For example, it doesn't show how
    many times a dictionary object is accessed to retrieve
    a key or how much time it takes.

    The dis module doesn't provide detailed information
    either. For the following code,

    dict = { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5}
    print dict.has_key('e')

    The dis module provides the following:

    0 LOAD_GLOBAL 0 (dict)
    3 LOAD_ATTR 1 (has_key)
    6 LOAD_CONST 1 ('e')
    9 CALL_FUNCTION 1
    12 PRINT_ITEM

    But this doesn't really help to see what's going on
    with the symbol table.

    Any help is greatly appreaciated. Thanks a lot!

    Regards,

    Dave



    __________________________________
    Yahoo! Mail - PC Magazine Editors' Choice 2005
    http://mail.yahoo.com
    Celine & Dave, Oct 3, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Christoph Becker-Freyseng

    Pssible Bug in Python Profiler

    Christoph Becker-Freyseng, Aug 13, 2003, in forum: Python
    Replies:
    0
    Views:
    262
    Christoph Becker-Freyseng
    Aug 13, 2003
  2. Scott Brady Drummonds

    Python Profiler Trouble

    Scott Brady Drummonds, Feb 24, 2004, in forum: Python
    Replies:
    1
    Views:
    338
    Josiah Carlson
    Feb 25, 2004
  3. Celine & Dave

    Python profiler

    Celine & Dave, Sep 30, 2005, in forum: Python
    Replies:
    2
    Views:
    588
    Peter Tillotson
    Oct 4, 2005
  4. Will Ware

    Interpreting python profiler results

    Will Ware, Mar 8, 2006, in forum: Python
    Replies:
    0
    Views:
    285
    Will Ware
    Mar 8, 2006
  5. potatosoftware
    Replies:
    0
    Views:
    652
    potatosoftware
    Nov 4, 2009
Loading...

Share This Page