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

Function Wrapper Cache #236

Merged
merged 5 commits into from
Apr 21, 2023

Conversation

martindevans
Copy link
Contributor

Added a cache to Function which stores wrapped function. This allows Wrap to be called multiple times without lots of allocations of the same thing.

This will work well with #235 - a Caller can ask for a Function object (cached) and then wrap it (cached) and then call it, all without allocating anything 🥳

…s Wrap to be called multiple times without lots of allocations of the same thing.
…d (one less allocation in the cached path).
@peterhuene peterhuene self-requested a review April 1, 2023 22:07
Copy link
Contributor

@kpreisser kpreisser left a comment

Choose a reason for hiding this comment

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

Looks good to me! Can you rebuild the project in order to regenerate Function.Wrap.cs, and commit it? (As my suggestion commit only modified Function.Wrap.tt.)
Thanks!

@martindevans
Copy link
Contributor Author

I've regenerated that file and pushed it 👍

Copy link
Member

@peterhuene peterhuene left a comment

Choose a reason for hiding this comment

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

Sorry for the delay in reviewing this. Looks good!

@peterhuene peterhuene merged commit 0c51117 into bytecodealliance:main Apr 21, 2023
@martindevans martindevans deleted the function-wrapper-cache branch April 21, 2023 12:38
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