Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add modern quickstart instructions to README #259

Merged
merged 1 commit into from
Apr 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 26 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,32 @@ They are available under a `BSD license`_.
.. contents::


Quick Start
===========
Quick Start (Modern)
====================

This guide is for versions of line profiler starting a ``4.1.0``.

To profile a python script:

* Install line_profiler: ``pip install line_profiler``.

* In the relevant file(s), import line profiler and decorate function(s) you
want to profile with ``@line_profiler.profile``.

* Set the environment variable ``LINE_PROFILE=1`` and run your script as normal.
When the script ends a summary of profile results, files written to disk, and
instructions for inspecting details will be written to stdout.

For more details and a short tutorial see `Line Profiler Basic Usage <https://kernprof.readthedocs.io/en/latest/#line-profiler-basic-usage>`_.


Quick Start (Legacy)
====================

This section is the original quick-start guide, and may eventually be removed
from the README. This will work with current and older (pre ``4.1.0``) versions
of line profiler.

To profile a python script:

* Install line_profiler: ``pip install line_profiler``.
Expand Down
Loading