Skip to content

Signature cache optimization #880

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dandiep
Copy link

@dandiep dandiep commented Apr 28, 2025

I had a single endpoints.py file with all my endpoints in it, but it got to be unmaintainable. The problem is that wiring went from ~1 sec to ~2.5 on my MacBook Pro M2! No logic changed.

I dug in and it seems that the _fetch_reference_injections doesn't do any caching and this is an expensive operation. I'm a bit unclear why it would be scanning things multiple times though? I added some caching and this bumped by performance back to do pre-file split speeds.

I'll admit I used Claude to help me do this as I'm not super up to speed on the codebase nor the ins and outs of the inspect module, but the overall change makes sense to me.

Thoughts?

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