Skip to content

Conversation

@copybara-service
Copy link

Allow functions to memoize themselves without being added to the query group.

This, in turn, lets us dismantle the God Object so that we don't need one giant struct with every function we ever dispatch to.

This, in turn, makes it potentially cheap and easy to use memoized functions from tests (we only need to set up the inputs), and makes it very simple to memoize expensive functions without refactoring all callers. (By convention, the first argument is always the db already!)

I'm not sold on the exact syntax -- in fact, I think it needs some work, and we should make it a proc macro wrapper thing so that we can apply it as an attribute and let rustfmt work, and even maybe to methods.

…y group.

This, in turn, lets us dismantle the God Object so that we don't need one giant struct with every function we ever dispatch to.

This, in turn, makes it potentially cheap and easy to use memoized functions from tests (we only need to set up the _inputs_), and makes it very simple to memoize expensive functions without refactoring all callers. (By convention, the first argument is always the db already!)

I'm not sold on the exact syntax -- in fact, I think it needs some work, and we should make it a proc macro wrapper thing so that we can apply it as an attribute and let rustfmt work, and even maybe to methods.

PiperOrigin-RevId: 860334587
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