Skip to content

Module registry: investigate data-structure optimizations #12111

@cfallin

Description

@cfallin

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    performancewasmtimeIssues about wasmtime that don't fall into another label

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions