ref: replace inspect.stack() with a more performant iteration of the current stack - #63965
Merged
Merged
Conversation
asottile-sentry
force-pushed
the
asottile-replace-inspect-stack
branch
from
January 26, 2024 18:50
b32bdbc to
ea711ea
Compare
Member
|
Some reference as to why this is needed: |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #63965 +/- ##
=======================================
Coverage 81.39% 81.40%
=======================================
Files 5228 5228
Lines 232470 232509 +39
Branches 40253 40254 +1
=======================================
+ Hits 189222 189264 +42
- Misses 37396 37397 +1
+ Partials 5852 5848 -4
|
asottile-sentry
added a commit
that referenced
this pull request
Jan 29, 2024
snigdhas
pushed a commit
that referenced
this pull request
Jan 30, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
inspect.stack()in python 3.11 is about 15x slower than in 3.10the new function I made is even faster than
inspect.stackeven in 3.10Details