Skip to content

Function Wrapper Cache#236

Merged
peterhuene merged 5 commits into
bytecodealliance:mainfrom
martindevans:function-wrapper-cache
Apr 21, 2023
Merged

Function Wrapper Cache#236
peterhuene merged 5 commits into
bytecodealliance:mainfrom
martindevans:function-wrapper-cache

Conversation

@martindevans
Copy link
Copy Markdown
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
Comment thread src/Function.Wrap.tt Outdated
martindevans and others added 2 commits April 3, 2023 15:58
Co-authored-by: Konstantin Preißer <kpreisser@users.noreply.github.com>
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

I've regenerated that file and pushed it 👍

Copy link
Copy Markdown
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