-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
In #12051 we added a new level of data structures to the per-store module registry due to the distinction between EngineCode and StoreCode. This leads to a small but consistent observed increase in instantiation time (~3% or 40ns in tests with a store of one small module).
In theory we could avoid the cost of materializing a separate StoreCode by making ModuleWithCode carry a view on some text/range, and building it to use EngineCode's text slice directly in the non-debug case. The commit here did enough of this to avoid a lookup in the engine-to-store-code map on the funcref init path, but we could carry it a bit further and avoid creating a StoreCode at all at instantiation.
There may be other optimizations we could do as well, after profiling.