Skip to content

Commit

Permalink
Add profiling instructions to CONTRIBUTING
Browse files Browse the repository at this point in the history
  • Loading branch information
esheehan-gsl committed Nov 17, 2023
1 parent d34c917 commit c08c6a0
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,29 @@ npm run lint
npm run format
```

## Profiling

If you need to do some performance profiling you can run the debug server with
`FLASK_PROFILE=True`. You’ll need to first create a directory for the profile
files:

```
mkdir -p tmp/profiler
FLASK_PROFILE=True poetry run flask run --debug
```

There are multiple ways you can view the `.prof` files generated by the
profiling middleware. One easy way to view them is with snakeviz.

```
poetry run pip install snakeviz
poetry run snakeviz tmp/profiler/<endpoint>.prof
```

That first line installs snakeviz in your virtual env (without adding it as a
dependency to the project) and the second will load a performance profile into
your default browser for you to view.

## Coding Style

### Python
Expand Down

0 comments on commit c08c6a0

Please sign in to comment.