Skip to content

li-js/line_profiler_example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

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

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages