Profiling Python - a summary of how I learned

5 views
Skip to first unread message

Jens Knutson

unread,
Dec 11, 2009, 12:13:45 AM12/11/09
to PyMNtos
Hi all,

There were some questions about profiling Python at tonight's
meeting. Here's a quick summary of the resources I used to profile a
performance problem I was fighting.

* A succinct but complete, start-to-finish review of how a Red Hat
engineer tracked down a performance issue in the Fedora/RHEL print
config tool: http://cyberelk.net/tim/2009/07/16/profiling-python/

* A talk from PyCon 2009, "Introduction to Python Profiling" --
includes slides and even a video of the talk:
http://us.pycon.org/2009/conference/schedule/event/15/

* The Python wiki pages about performance profiling:
- A page of general principles and advice: http://wiki.python.org/moin/PythonSpeed
- ...and a (very helpful!) page of more specific, practical-level
info and techniques: http://wiki.python.org/moin/PythonSpeed/PerformanceTips

Finally, there's "RunSnakeRun", which is the GUI tool I mentioned
tonight, for visually analyzing the output from Python's cProfile
module (it's written by the same guy who gave the PyCon 2009 talk
listed above.): http://www.vrplumber.com/programming/runsnakerun/

Hope this helps. If any of you have questions, please ask away, and
I'll answer as best I can.

- Jens


p.s. I had a great time at the meeting tonight, and I'm very much
looking forward to the next one!

Jens Knutson

unread,
Dec 11, 2009, 1:03:46 AM12/11/09
to PyMNtos
Oh, and if you watch that PyCon 2009 video:

1) Try to grin and bare it every time he says "pro-cess" with a long
"o", and "cache" with a long "a" ("cayshe") ...*shudder*
2) Pay no mind to his comment about importing PyGTK being
"ridiculously slow":

[jensck@Prodigal ~]$ time python -c "import gtk"

real 0m0.187s
user 0m0.114s
sys 0m0.022s


;-P

matt westerburg

unread,
Dec 11, 2009, 2:23:35 AM12/11/09
to pym...@googlegroups.com
There is also a decent pycon video.
Reply all
Reply to author
Forward
0 new messages