Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

A simple example of performing line-by-line time profiling in python

Install the profiler

The line profiler is from https://github.com/rkern/line_profiler.git.

pip install line_profiler

Note that it will install a binary command ''kernprof'' and a python library module ''line_profiler''.

Run and convert the original python file

kernprof -l example.py 

Note that @profile decorator is used to define the functions we want to perform profiling in the python script. The output file after the execution is example.py.lprof.

Get the profiled results

python -m line_profiler example.py.lprof

About

No description, website, or topics provided.

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages