Skip to content

Conversation

@dcw02
Copy link

@dcw02 dcw02 commented Jun 17, 2025

In certain execution environments with complex call stacks, inspect.stack() can become very expensive and add a significant amount of overhead to inference calls. This PR replaces it with a limited manual stack walk using sys._getframe() to avoid the overhead of loading all the stack frames.

@jimmyt857 jimmyt857 removed their request for review June 29, 2025 21:29
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.

1 participant