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 b181181
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,29 @@ service is as simple as:
npm run vendor && npm run build
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
Expand Down

0 comments on commit b181181

Please sign in to comment.