Skip to content
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

[dispatcher] Optimize primary method calculation #152

Merged
merged 1 commit into from
Sep 19, 2024

Conversation

alexander-yakushev
Copy link
Contributor

This PR makes small optimizations to the process of computing a primary method (namely, to matching-primary-methods function). The changes are mostly structural – replacing lazy transforms and expensive iteration with eager and optimized counterparts.

At first, I was under the impression that the time to construct a method for a dispatch value should not matter because of caching, but here and there in Metabase I find cases where the method is reconstructed – either because the method can't be cached, or in situations like camsaul/toucan2#180. Hence, improving the efficiency of this otherwise cacheable process is still worth doing.

Copy link
Owner

@camsaul camsaul left a comment

Choose a reason for hiding this comment

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

This looks great, thanks!

@camsaul camsaul merged commit af7cd57 into camsaul:master Sep 19, 2024
6 checks passed
@alexander-yakushev alexander-yakushev deleted the opt-primary-method branch September 19, 2024 17:49
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.

2 participants