Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

More stack-related performance improvements#2844

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
mxschmitt merged 3 commits intomicrosoft:mainfromneoncube2:only-grab-needed-frames
May 12, 2025

Conversation

neoncube2
Copy link
Contributor

@neoncube2neoncube2 commentedMay 8, 2025
edited
Loading

Building off of#2835, this PR replaces the remaining instances ofstack() withstack(0), so that we avoid getting context information for the first frame of the stack, which is expensive.

I also discovered that we were callingtraceback.format_list(traceback.extract_stack()[-10:]), which does the following:

  1. Extract the entire stack
  2. Format the entire stack into strings
  3. Throw away everything except for the last 10 formatted frames of the stack

To fix this, I've madeextract_stack() use thelimit=10 parameter.

Finally, I optimized_path_utils.py to only retrieve two frames from the stack, instead of retrieving the entire stack and then discarding everything but the second frame :)

@neoncube2
Copy link
ContributorAuthor

@mxschmitt Sorry, I accidentally closed and reopened the pull request '-_-

@mxschmittmxschmitt merged commit55b2800 intomicrosoft:mainMay 12, 2025
74 of 75 checks passed
@neoncube2neoncube2 deleted the only-grab-needed-frames branchMay 12, 2025 19:01
@neoncube2
Copy link
ContributorAuthor

@mxschmitt Woohoo, thanks! ^_^

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@mxschmittmxschmittmxschmitt approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@neoncube2@mxschmitt

[8]ページ先頭

©2009-2025 Movatter.jp