michael-weigelt opened PR #15366 from michael-weigelt:mwe/perf to bytecodealliance:main:
This has been discussed in a private conversation on zulip with @alexcrichton and @fitzgen .
During compilation, cranelift calls
Module::is_exported_memoryinmemory_alias_regionfor every Wasm instruction that accesses memory. That method iterates through all exports, so if there are many of those and many accesses, it can slow down compilation significantly.This PR addresses that by making
Module.exportsa struct that keeps some auxiliary sets and keeps them in sync with the exports map. The public interface of the new structModuleExportsexposes just what's currently needed by callers, but can be easily extended.
michael-weigelt removed the review request for wasmtime-core-reviewers from PR #15366.
michael-weigelt requested dicej for a review on PR #15366.
michael-weigelt requested wasmtime-core-reviewers for a review on PR #15366.
:thumbs_up: alexcrichton submitted PR review.
alexcrichton added PR #15366 perf: Lookup whether a global/memory/table is exported in constand time to the merge queue.
:check: alexcrichton merged PR #15366.
alexcrichton removed PR #15366 perf: Lookup whether a global/memory/table is exported in constand time from the merge queue.
Last updated: Nov 19 2026 at 20:05 UTC