Skip to content

Make class_uses_recursive() and trait_uses_recursive() helpers onceable #56069

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

Closed
wants to merge 4 commits into from

Conversation

shaedrich
Copy link
Contributor

Classes rarely change at runtime, however, checking their dependencies every time we need them—sometimes even recursively—can be expensive. So, caching them makes sense.

Suggested by @cosmastech

See: #56060 (comment)

shaedrich and others added 2 commits June 18, 2025 10:49
Co-authored-by: Wes Hooper <weshooper@users.noreply.github.com>

Co-authored-by: Wes Hooper <weshooper@users.noreply.github.com>
Co-authored-by: Wes Hooper <weshooper@users.noreply.github.com>

Co-authored-by: Wes Hooper <weshooper@users.noreply.github.com>
@taylorotwell
Copy link
Member

I don't think you even need to use once. Just use a static variable.

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.

3 participants