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

Use getframe instead of stack #15

Merged
merged 3 commits into from
Aug 27, 2024
Merged

Use getframe instead of stack #15

merged 3 commits into from
Aug 27, 2024

Conversation

RouganStriker
Copy link
Member

The inspect.stack call is rather expensive and makes opening multiple contexts in a sequence rather expensive. Since we only need to grab a specific frame from the stack, we can opt for using getframe instead of fetching the entire stack.

pyproject.toml Outdated Show resolved Hide resolved
depocs/__init__.py Outdated Show resolved Hide resolved
Copy link
Member

@emily-bain emily-bain left a comment

Choose a reason for hiding this comment

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

+1.

This all looks technically sound to me, Good job on finding the alternate frame method that was a more efficient way to get the same thing we were getting via inspect.

@RouganStriker RouganStriker merged commit 02a8102 into master Aug 27, 2024
1 check passed
@RouganStriker RouganStriker deleted the tech/use_getframe branch August 27, 2024 18:56
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