Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Do not call getfullargspec on every call. #16589

Merged
merged 2 commits into from
Oct 31, 2023
Merged

Do not call getfullargspec on every call. #16589

merged 2 commits into from
Oct 31, 2023

Conversation

clokep
Copy link
Member

@clokep clokep commented Oct 31, 2023

getfullargspec is relatively expensive (I was seeing it at ~3% of total runtime in some profiles), the function isn't going to change in this case so we don't need to call it on each iteration, just while creating the wrapper.

@clokep clokep marked this pull request as ready for review October 31, 2023 19:58
@clokep clokep requested a review from a team as a code owner October 31, 2023 19:58
Copy link
Contributor

@DMRobertson DMRobertson left a comment

Choose a reason for hiding this comment

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

Neat!

@clokep clokep enabled auto-merge (squash) October 31, 2023 20:05
@clokep clokep merged commit ed1b879 into develop Oct 31, 2023
41 checks passed
@clokep clokep deleted the clokep/argspec-once branch October 31, 2023 20:16
@clokep
Copy link
Member Author

clokep commented Nov 3, 2023

In a similar profile to above this now only takes ~0.5% of runtime, instead of ~3.3%.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants