A module for doing line-by-line profiling of functions for Python
line_profiler and kernprof
line_profiler is a module for doing line-by-line profiling of functions. kernprof is a convenient script for running either line_profiler or the Python standard library’s cProfile or profile modules, depending on what is available.
Installation
Note: As of version 2.1.2, pip install line_profiler does not work. Please install as follows until it is fixed in the next release:
git clone https://github.com/rkern/line_profiler.git find line_profiler -name ‘*.pyx’ -exec cython {} ; cd line_profiler pip install . –user
Releases of line_profiler can be installed using pip:
$ pip install line_profiler
Source releases and any binaries can be downloaded from the PyPI link.
To check out the development sources, you can use Git:
$ git clone https://github.com/rkern/line_profiler.git
You may also download source tarballs of any snapshot from that URL.
Source releases will require a C compiler in order to