-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
After Migration initial import of Model object is 100 times slower #7263
Comments
Seems related to #6768. Could you provide any sort of hints as to the structure of your model (recursiveness, number of fields, etc.), or anything else that might help us narrow down the issue? |
It's a very large model with a couple of circular dependencies. The source for the model I am importing is available here: Referenceable |
We are also experiencing very slow (unusable) import times for our similarly recursive model. Would be great to get some kind of fix, guessing caching for recursive models. |
Please see #6768 (comment) |
I get a 404 now. @ErnestoLoma would you mind testing out |
@adriangb Adrian I tried it with pydantic 2.3.0
|
2.3.0 does not have the fix. Please try 2.4.0 or |
@adriangb The time to import was 214.18017506599426 seconds. So slightly better. I did the install using pip install git+https://github.com/pydantic/pydantic.git |
Could you try against |
Is there any progress on this issue? It is a big blocker for us to migrate to v2. |
We'll look to make some progress on this issue in the coming weeks, as we know it's limiting folks in terms of ability to upgrade! |
Initial Checks
Description
I'm in the process of migrating from pydantic 1.10.8 to 2.2.1. Using pydantic 1.10.8 an import of a model class took approximately 2.5 seconds. Using pydantic 2.2.1 it take approximately 244.2 seconds.
pydantic 1.10.8 output: The time to import Referenceable is: 2.5116748809814453 seconds
pydantic 2.2.1 output: The time to import Referenceable is: 244.24540090560913 seconds
Below is the script I am using for timing:
Example Code
Python, Pydantic & OS Version
Selected Assignee: @Kludex
The text was updated successfully, but these errors were encountered: