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

PERF: wrap inspect.getsourcelines with cache #532

Merged
merged 2 commits into from
Mar 20, 2024

Conversation

dontgoto
Copy link
Contributor

While looking into some docstring checks for pandas I saw the opportunity to shave off about 1s of our remaining 7s runtime of numpydoc functions by wrapping inspect.getsourcelines with a cache since it usually gets called twice with the same arguments and it is comparatively expensive.

Copy link
Contributor

@rossbar rossbar left a comment

Choose a reason for hiding this comment

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

Seems reasonable to me - it'd be nice to chase down why the full parsing is called twice and whether there's a way to eliminate that, but that's a separate issue. Thanks @dontgoto !

@rossbar rossbar merged commit 19167fe into numpy:main Mar 20, 2024
26 of 27 checks passed
@stefanv stefanv added this to the 1.7.0 milestone Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants