Atom Packages Directory

a package directory for a text editor of the 21st Century

Python Line Profiler by Ivan David Di Lernia

Install with:
    apm install python-line-profiler

Python line profiler for Atom



How to run

1) Make sure you’re using the right environment. This is done by modifying the ‘Shell command’ option in the settings.


The default, /usr/bin/python, works for small tests. However it might be the case you’re using virtualenvs and/or running code from a virtual machine.

Example setting of running profiler from a virtual environment in a VM:

ssh, vagrant@, -t, /home/user/project/venv/bin/python

2) ALT+SHIFT+P to activate

This will show an editor with a Run button.

3) Import the function to profile first. The profiler is executed from the parent directory of the profiled code (this doesn’t matter if you choose a custom shell command).

Use the profile function to run a profile on your code.

The end product should look something like


4) Stats will appear in the editor gutter

Keywords: profiling, python Suggest keywords
Fork me on GitHub