Skip to content
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

Set defer_build=True pydantic config, improving import time significantly #643

Merged
merged 4 commits into from
Oct 23, 2024

Conversation

LewisGaul
Copy link
Collaborator

@LewisGaul LewisGaul commented Oct 19, 2024

Partially addresses #552. This config option is suggested in pydantic/pydantic#6748.

Before:

$time python -c "import python_on_whales"

real    0m0.405s
user    0m0.401s
sys     0m0.023s

After:

$time python -c "import python_on_whales"

real    0m0.206s
user    0m0.206s
sys     0m0.011s

Copy link
Owner

@gabrieldemarmiesse gabrieldemarmiesse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked into it and indeed it makes a lot of sense. Thanks! We can merge this when the CI is fixed.

@gabrieldemarmiesse gabrieldemarmiesse enabled auto-merge (squash) October 23, 2024 10:07
@gabrieldemarmiesse gabrieldemarmiesse merged commit d992525 into gabrieldemarmiesse:master Oct 23, 2024
21 checks passed
@LewisGaul LewisGaul deleted the defer-build branch October 23, 2024 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants