-
Notifications
You must be signed in to change notification settings - Fork 69
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
Upgrade to the latest OpenAPI generator #293
Comments
@tomplus maybe it would be worth having a generator option to not load all the models from the Typically, I'm using only a very small subset of all the available models, but importing If we could reduce this default list to something smaller, and have to explicitly import the extra classes you need, I think it could help a lot. |
I did such tests using lazy imports (models were loaded only when needed) and it worked 3x faster but still 10x slower than the current version (see timings above). The problem is that each model requires other models and these models required others and still you need to load many of them... |
I've tried to use the latest version of OpenAPI generator to generate the library. That version uses Pydantic2 to generate models. Unfortunately kubernetes library contains ~600 models/api and loading time (at startup) is huge and not acceptable, especially for scripts, long running applications import modules once so it's not so painful. I tried to replace imports with lazy imports as a workaround but it's still 10 time worse in compare with current version using old generator.
My tests:
The problem is known and may be resolved in the future: pydantic/pydantic#6748
For now I' m going to switch to the version just before Pydantic. It helps to resolve some pending issues, and this issue is for tracking ideas or attempts for future upgrades.
The text was updated successfully, but these errors were encountered: