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

[hydrate] Use cached Methodical function to check for mm implementation #180

Merged
merged 1 commit into from
Sep 19, 2024

Conversation

alexander-yakushev
Copy link
Contributor

m/effective-primary-method, which was used in can-hydrate-with-strategy? to check if a particular hydration strategy is available for a model, constructs a primary method every time it is invoked. Instead, m/effective-method will try to lookup a cached method for the given dispatch value if the mm is a CachedMultiFnImpl (it is by default).

Note that caching only works for hits. If the method isn't implemented for a particular dispatch value, Methodical will go through the expensive process of trying to construct a method.

Copy link

codecov bot commented Sep 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.23%. Comparing base (33b4f54) to head (618a3b7).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #180   +/-   ##
=======================================
  Coverage   83.23%   83.23%           
=======================================
  Files          37       37           
  Lines        2511     2511           
  Branches      215      215           
=======================================
  Hits         2090     2090           
  Misses        206      206           
  Partials      215      215           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

Wow, great catch. Thanks for this!

@camsaul camsaul merged commit e14a45e into camsaul:master Sep 19, 2024
10 checks passed
@alexander-yakushev alexander-yakushev deleted the can-hydrate-with branch September 19, 2024 17:48
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