S7 B.TECH CSE
AMRITA VISHWA VIDYAPEETHAM, INDIA
What Is Profiling?
Analysis of a program to measure the memory used by a certain module,
frequency and duration of function calls and the time complexity of the
Such profiling tools are termed as ‘profilers’.
Development tools in python
History of line_Profiler
Initial Release v1.0b1 (2008) by Robert Kern.
v1.0b2 (2009) – Fixes related to timing overflow on Windows.
v1.0b3 (2011) – Update Compatibility for newer versions of Cython and
v1.0 (2014, stable release) – Added compatibility for Python 3.x
Previously supported by kmike’s bitbucket fork of line_profiler.
Function : Displays the name of the function which is profiled and its line number.
Line# : Line number of the code in the respective file.
Hits : Number of times the code in the respective line was executed.
Time : Total amount of time spent in executing the line in ‘Timer unit’ (i.e 1e-06s here). May
vary from system to system.
Per Hit : The average amount of time spent in executing the line once in Timer Unit.
% Time : The percentage of time spent on that line with respect to the total amount of
recorded time spent in the function.
Line Contents : It displays the actual source code.
Line_profiler helps us to point out which module of our code is running
slower than expected by profiling the time taken by each line of code.
Helps in testing large projects, time spent by modules to execute a
Using this data we can modify and improve our code to build faster and
better programs and softwares.