Skip to content

Latest commit

 

History

History
28 lines (20 loc) · 518 Bytes

profiler.md

File metadata and controls

28 lines (20 loc) · 518 Bytes

How to profile your code in IPython

Line profiling

Using the built-in prun magic

%prun foo(1000)

Using the line-profiler extension

In a command line:

pip install line-profiler

In the IPython console.

First, load the line_profiler extension:

%load_ext line_profiler

Then, line profile your function foo (for example):

%lprun -f foo foo(1000)