O'Reilly logo

Mastering Python High Performance by Fernando Doglio

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

line_profiler

This profiler is different from cProfile. It helps you profile a function line by line instead of doing a deterministic profiling, like the other one does.

To install this profiler, you can use the pip (https://pypi.python.org/pypi/pip) command-line tool, with the following command:

$ pip install line_profiler

Note

If you run into any trouble, such as missing files during installation, make sure you have all development dependencies installed. In the case of Ubuntu, you can ensure that all the dependencies are installed by running the following command:

$ sudo apt-get install python-dev libxml2-dev libxslt-dev

This profiler is trying to fill in a breach left by cProfile and others like it. Other profilers cover CPU time on function ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required