Skip to content

[jit] Speed up resolution callback creation#12859

Closed
driazati wants to merge 1 commit intopytorch:masterfrom
driazati:rcb_spd
Closed

[jit] Speed up resolution callback creation#12859
driazati wants to merge 1 commit intopytorch:masterfrom
driazati:rcb_spd

Conversation

@driazati
Copy link
Copy Markdown
Contributor

@driazati driazati commented Oct 19, 2018

inspect.stack() calls are slow since they access a bunch of extra info about the frame. This PR instead uses inspect.currentframe() and goes up the stack until it reaches the correct frame. Context

Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:
Copy link
Copy Markdown
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

driazati has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link
Copy Markdown
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

driazati is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@ezyang ezyang added the merged label Jun 25, 2019
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
Summary:
`inspect.stack()` calls are slow since they access a bunch of extra info about the frame. This PR instead uses `inspect.currentframe()` and goes up the stack until it reaches the correct frame. [Context](stackoverflow.com/questions/17407119/python-inspect-stack-is-slow)
Pull Request resolved: pytorch#12859

Differential Revision: D10509912

Pulled By: driazati

fbshipit-source-id: b85325adf1b3c85a1a3a82e96e567b8be498531b
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.

4 participants