Skip to content

Hoist introspection out of per-call ctype dispatch#2742

Open
gronsti-amd wants to merge 1 commit intoROCm:mainfrom
gronsti-amd:sgronroo/cache-ctypes-introspection
Open

Hoist introspection out of per-call ctype dispatch#2742
gronsti-amd wants to merge 1 commit intoROCm:mainfrom
gronsti-amd:sgronroo/cache-ctypes-introspection

Conversation

@gronsti-amd
Copy link
Copy Markdown

Hoist inspect.signature/typing.get_type_hints out of per-call ctype dispatch

These two introspection calls were recomputed on every invocation of the ctypes caller closure (~79µs + ~91µs per call). Since the decorated function's signature and type hints are immutable, compute them once at decoration time and capture via closure.

Motivation

Technical Details

Test Plan

Test Result

Submission Checklist

…dispatch

These two introspection calls were recomputed on every invocation of
the ctypes caller closure (~79µs + ~91µs per call). Since the decorated
function's signature and type hints are immutable, compute them once at
decoration time and capture via closure.

Made-with: Cursor
@gronsti-amd gronsti-amd requested review from a team and amd-ruitang3 April 14, 2026 11:07
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