You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For serverless setups, startup time is pretty important.
Even for local development, django's runserver or uvicorn's reload are both much slower with imports like these.
Of course you can do the import locally everywhere stripe is used, but this can be problematic.
At the very least, some guidance in the docs on how to do imports and have a lazy-loaded client would help. Something like a central get_stripe_client() -> Stripe or the like. And cover thread-safety in here.
Code snippets
No response
OS
macOS
Language version
3.12.1
Library version
11.3.0
API version
2020-08-27
Additional context
No response
The text was updated successfully, but these errors were encountered:
Cold start platforms: Google Cloud Run in my case.
But it also has local dev implications. Django and FastAPI rely on an autoreloading server. Unlike frontend tools like vite, there's no concept of hot module reloading. So this library — with no usage, just importing — is responsible for a 500ms lag in restarts.
Imagine a few other libraries like this (Google storage does the same thing), and it starts to add up.
Describe the bug
I looked around, searched the issues and even googled. Surprised this hasn't come up.
Just importing the library adds 500ms to startup time. There's got to be a way to lazy load parts.
This is on a top of the line Mac with SSD.
To Reproduce
Expected behavior
For serverless setups, startup time is pretty important.
Even for local development, django's runserver or uvicorn's reload are both much slower with imports like these.
Of course you can do the import locally everywhere stripe is used, but this can be problematic.
At the very least, some guidance in the docs on how to do imports and have a lazy-loaded client would help. Something like a central
get_stripe_client() -> Stripe
or the like. And cover thread-safety in here.Code snippets
No response
OS
macOS
Language version
3.12.1
Library version
11.3.0
API version
2020-08-27
Additional context
No response
The text was updated successfully, but these errors were encountered: