Interpreting python profiler results

Will Ware will.ware at gmail.com
Wed Mar 8 02:47:56 CET 2006


I'm working on a piece of software that uses PyQt and PyOpenGL for
drawing acceleration. While profiling it to find opportunities to speed
things up, I got this from the profiler:

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
12108/12084   55.390    0.005   55.390    0.005 :0(getattr)
     2934    0.430    0.000    1.240    0.000
files_mmp.py:344(_read_atom)
        1    0.310    0.310   59.240   59.240 :0(exec_loop)
     2934    0.210    0.000    0.310    0.000
chem.py:1774(best_atomtype_for_numbonds)
     8737    0.150    0.000    0.190    0.000 :0(map)
     2944    0.150    0.000    0.450    0.000 chem.py:288(__init__)
     ....more.....

I assume ":0(getattr)" means a getattr function in either PyQt or
PyOpenGL. I grepped the sources of both looking for getattr, and it
doesn't appear in PyQt but appears frequently in PyOpenGL. Does anybody
know if I am correct in my conclusion that most of the program's time
is being spent in some getattr function in PyOpenGL?

Thanks
Will Ware




More information about the Python-list mailing list