-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
perf: Cache register plugin function #18860
perf: Cache register plugin function #18860
Conversation
@@ -111,6 +112,7 @@ def _serialize_kwargs(kwargs: dict[str, Any] | None) -> bytes: | |||
return pickle.dumps(kwargs, protocol=5) | |||
|
|||
|
|||
@lru_cache(maxsize=16) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a large number of pathlib objects can be heavy to cache: psf/black#1950. so i think it's good to set a maxsize
I think it's very unlikely that anyone would be using more than 16 plugins in the same project anyway..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not in a hot loop at least.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a large number of pathlib objects can be heavy to cache: psf/black#1950. so i think it's good to set a maxsize
I think it's very unlikely that anyone would be using more than 16 plugins in the same project anyway..
Does 16 mean 16 different plugin functions or 16 distinct plugins?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NVM, should be 16 plugin packages..
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #18860 +/- ##
=======================================
Coverage 79.87% 79.88%
=======================================
Files 1519 1519
Lines 205839 205841 +2
Branches 2898 2899 +1
=======================================
+ Hits 164416 164438 +22
+ Misses 40875 40855 -20
Partials 548 548 ☔ View full report in Codecov by Sentry. |
closes #18857
Can confirm that this resolves the issue
before:
after: