A good article on optimization

Stéfan van der Walt stefan at sun.ac.za
Mon Jun 6 06:33:50 EDT 2011


On Sat, Jun 4, 2011 at 1:45 PM, Pieter Holtzhausen <holtzhau at gmail.com> wrote:
> http://scikit-learn.sourceforge.net/dev/developers/performance.html
> from our scikits-learn brethren.

It's a pity this page doesn't yet document the valgrind / kcachegrind
approach; I find this to be by far the most useful way of examining
Cython bottlenecks!

Graphical visualisation of Python code:

$ easy_install RunSnakeRun
$ python -m cProfile -o prof.data scriptname
$ runsnake prof.data

Graphical visualisation of extensions:

$ valgrind --tool=callgrind -v --dump-instr=yes --trace-jump=yes
  --callgrind-out-file=callgrind.log python benchmark.py
$ kcachegrind callgrind.log

Cheers
Stéfan



More information about the scikit-image mailing list