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

revert plugin performance regression #7589

Merged
merged 5 commits into from
Sep 25, 2023
Merged

Conversation

samuelcolvin
Copy link
Member

@samuelcolvin samuelcolvin commented Sep 25, 2023

Avoid loading plugins, and thereby iterating over importlib_metadata.distributions() ever time a model is created.

Instead we only look for plugins is we haven't looked before, or loading plugins previously failed.

Selected Reviewer: @lig

@samuelcolvin samuelcolvin added the relnotes-performance Used for performance improvements. label Sep 25, 2023
@cloudflare-pages
Copy link

cloudflare-pages bot commented Sep 25, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 096fb4b
Status: ✅  Deploy successful!
Preview URL: https://d27e9175.pydantic-docs2.pages.dev
Branch Preview URL: https://plugin-performance-regressio.pydantic-docs2.pages.dev

View logs

@samuelcolvin samuelcolvin mentioned this pull request Sep 25, 2023
7 tasks
@samuelcolvin
Copy link
Member Author

please review

Copy link
Contributor

@lig lig left a comment

Choose a reason for hiding this comment

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

just a couple of nuances...

pydantic/plugin/_loader.py Outdated Show resolved Hide resolved
tests/plugin/example_plugin.py Outdated Show resolved Hide resolved
@samuelcolvin samuelcolvin assigned lig and unassigned dmontagu Sep 25, 2023
@samuelcolvin samuelcolvin enabled auto-merge (squash) September 25, 2023 10:16
@samuelcolvin samuelcolvin merged commit 0af0cc3 into main Sep 25, 2023
58 checks passed
@samuelcolvin samuelcolvin deleted the plugin-performance-regression branch September 25, 2023 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for review relnotes-performance Used for performance improvements.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants