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 pyinstrument for performance benchmarking #6292

Open
Tracked by #6332
robsavoye opened this issue Mar 19, 2024 · 8 comments
Open
Tracked by #6332

Add pyinstrument for performance benchmarking #6292

robsavoye opened this issue Mar 19, 2024 · 8 comments

Comments

@robsavoye
Copy link
Contributor

To enable performance testing, support for pyinstrument should be added to the backend. This can be then run optionally via an additional parameter to the REST API call. This also needs way to export the results outside of docker.

@robsavoye robsavoye added priority: medium status: testing Does it really work or is it pretending to work? Component: Backend labels Mar 19, 2024
@spwoodcock
Copy link
Member

This should only be available during local development & not in any of the public facing instances 👍

@spwoodcock
Copy link
Member

But could go to the staging server temporarily if necessary for performance issue investigations

@robsavoye
Copy link
Contributor Author

My plan was to have this in a "perf" branch, not develop or main.

@spwoodcock
Copy link
Member

I won't be deployed anywhere in that case 👍
Just for local testing.

However, if you merge the branch then we want to make sure pyinstrument is not included in production by using Python dependency groups and having a multistage dockerfile that uses different groups for each build target

@robsavoye
Copy link
Contributor Author

I don't plan to make any code changes other than whatever it takes to get some performance statistics. It shouldn't effect the docker image at all, I used pdm to install the module manually.

@ramyaragupathy ramyaragupathy changed the title Add pyinstrument to docker image Add pyinstrument for performance benchmarking Apr 11, 2024
@ramyaragupathy
Copy link
Member

We need to have the pyinstrument integration in two places:

  • one in Fast API migration and
  • also in the current codebase

so that we do the performance comparison between both the setups

cc @kaditya97 @robsavoye @spwoodcock

@kaditya97
Copy link
Member

@ramyaragupathy
Copy link
Member

@kaditya97 - here is some previous work on profiling https://github.com/hotosm/tasking-manager/tree/develop/scripts/profiler

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants