-
-
Notifications
You must be signed in to change notification settings - Fork 6k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
performance latency after updating to Fastapi > 0.82.0 #5602
Comments
It really helps other people debug problems like this if you can produce a test harness that demonstrates the issue succinctly. |
Thanks @jgould22 ! 🍰 Indeed, please provide an example code that shows your problem so that I (we) can replicate it and investigate it here. Otherwise it's just blind guesses... 😅 You can start by upgrading other dependencies too, in case that has anything to do with it. |
Thank you guys for your reply @tiangolo , @jgould22 i appreciate it. ok, let's put more context to this, i have a lot of tests unit test and integrations, but what i'm going to do here to illustrate the performance pblm, i am going to take one of simplest tests i have in which i test if my strings gets strip correctly before getting inserted to the DB. Then i'll proceed to show you the timing made to perform this test in both of the versions Fastapi version 0.82.0 and Fastapi 0.85.0 or any greater version than 0.82.0. so let's first show you ho i handle my dependency:
this is my middleware to catch all exceptions raised
okay, let's then take a look to the test
Let's compare results for fastapi 0.82.0 or less i get around 0.70 sto run the above test. you can see this in hte following logs :
for fastapi > 0.82.0, it takes 1.58 s to do the same thing
As you can imagine this only for one simple test but since i got a lot whole more you can clearly feel the latency between the version 0.82.0 and any version > 0.82.0 . is the way i raise expection in my session dependency, has to do something with it ? maybe something changed in on how to handle exceptions using dependency? |
It's hard to tell without seeing all the code and being able to run something. If you can provide a minimal, self-contained code example that shows your problem so that I can replicate it and investigate it here that would be great. 🙏 Otherwise it's just blind attempts at imagining your code and what could be happening. |
Thanks @tiangolo |
Thanks for reporting back and closing the issue 👍 |
Assuming the original need was handled, this will be automatically closed now. But feel free to add more comments or create new issues or PRs. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
First Check
Commit to Help
Example Code
Description
i noticed that after i've updated Fastapi to a superior version > 0.82.0, i noticed that mu integrations tests are stuck and keeps running in a slow manner, which is not the usual behavior of any version that is less than <= 0.82.0 , Can anyone confirm the same behavior please ? i can not understand why i have a really long latency is my dependency causing this, becuz since the 0.82.0, i have changed it to this after the fix in PR #5122 .
Can anybody help me figure out why updalting to any superior > 0.82.0 i have this much latency ?
Thank you guys.
Operating System
Linux
Operating System Details
No response
FastAPI Version
0.82.0
Python Version
3.10
Additional Context
No response
The text was updated successfully, but these errors were encountered: