tasking-manager icon indicating copy to clipboard operation
tasking-manager copied to clipboard

Add pyinstrument for performance benchmarking

Open robsavoye opened this issue 11 months ago • 8 comments

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 avatar Mar 19 '24 06:03 robsavoye

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

spwoodcock avatar Mar 19 '24 09:03 spwoodcock

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

spwoodcock avatar Mar 19 '24 09:03 spwoodcock

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

robsavoye avatar Mar 19 '24 10:03 robsavoye

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

spwoodcock avatar Mar 19 '24 10:03 spwoodcock

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.

robsavoye avatar Mar 19 '24 10:03 robsavoye

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

ramyaragupathy avatar Apr 11 '24 14:04 ramyaragupathy

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

ramyaragupathy avatar Apr 17 '24 10:04 ramyaragupathy