fitzgen opened PR #12412 from fitzgen:dont-pass-module-to-initialize-vmctx to bytecodealliance:main:
Get it from
self, which means we can't ever pass in the wrong module.<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
fitzgen requested dicej for a review on PR #12412.
fitzgen requested wasmtime-core-reviewers for a review on PR #12412.
alexcrichton submitted PR review:
The purpose of this is to avoid the
Arc::clonewhich can be pretty hotly contested here since if many threads instantiate the same module/component that'll cause lots of incs/decs on the same memory location. Historically I don't recall this being a problem here exactly, but we have at least one bug report showing a 30% slowdown in throughput for an optimized host function if we include anArc::cloneby accident.Instead of a clone, however, how about something like what components do?
fitzgen updated PR #12412.
fitzgen requested alexcrichton for a review on PR #12412.
alexcrichton submitted PR review.
fitzgen added PR #12412 Don't pass module into initialize_vmctx to the merge queue
fitzgen merged PR #12412.
fitzgen removed PR #12412 Don't pass module into initialize_vmctx from the merge queue
Last updated: Jan 29 2026 at 13:25 UTC