alexcrichton opened PR #3293 from less-dynamic
to main
:
This commit optimizes the runtime execution of
Func::new
by removing
an indirect function call that happens whenever a host function is
called. This indirection was generally done to prevent monomoprhizing a
lot into consumer code but the few extra functions this makes
monomorphic are fairly small, and in general wasm->host call performance
is pretty important.While not a massive win this is expected to improve codegen, especially
because with the indirect call removed the compiler should now be able
to prove more often when aFunc::new
closure doesn't panic or return
an error.<!--
Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
bjorn3 submitted PR review.
bjorn3 created PR review comment:
I think it would be a bit cleaner to inline this function given how small it is.
cfallin submitted PR review.
alexcrichton updated PR #3293 from less-dynamic
to main
.
abrown submitted PR review.
abrown created PR review comment:
You probably meant to remove this?
alexcrichton updated PR #3293 from less-dynamic
to main
.
alexcrichton submitted PR review.
alexcrichton created PR review comment:
Oops, yes!
alexcrichton merged PR #3293.
Last updated: Dec 23 2024 at 12:05 UTC