Stream: git-wasmtime

Topic: wasmtime / issue #4026 Clone fewer Arc<T> from a `Linker`...


view this post on Zulip Wasmtime GitHub notifications bot (Apr 13 2022 at 21:31):

alexcrichton opened issue #4026:

Currently when a Linker<T> is used to instantate a module within a Store we'll use HostFunc::to_func to convert the linker-defined function into a function that lives within the Store. This operation, however, is somewhat costly where it will clone an Arc for the Store to hold onto. This means that when the Store is dropped that Arc is also dropped. This happens once-per-function-import in a Store which when modules import dozens of functions this ends up being a very hotly-contended Arc when instantiation is happening on multiple threads simultaneously.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 13 2022 at 21:49):

alexcrichton labeled issue #4026:

Currently when a Linker<T> is used to instantate a module within a Store we'll use HostFunc::to_func to convert the linker-defined function into a function that lives within the Store. This operation, however, is somewhat costly where it will clone an Arc for the Store to hold onto. This means that when the Store is dropped that Arc is also dropped. This happens once-per-function-import in a Store which when modules import dozens of functions this ends up being a very hotly-contended Arc when instantiation is happening on multiple threads simultaneously.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 27 2022 at 15:01):

alexcrichton commented on issue #4026:

Fixed during https://github.com/bytecodealliance/wasmtime/pull/4051

view this post on Zulip Wasmtime GitHub notifications bot (Apr 27 2022 at 15:01):

alexcrichton closed issue #4026:

Currently when a Linker<T> is used to instantate a module within a Store we'll use HostFunc::to_func to convert the linker-defined function into a function that lives within the Store. This operation, however, is somewhat costly where it will clone an Arc for the Store to hold onto. This means that when the Store is dropped that Arc is also dropped. This happens once-per-function-import in a Store which when modules import dozens of functions this ends up being a very hotly-contended Arc when instantiation is happening on multiple threads simultaneously.


Last updated: Nov 22 2024 at 17:03 UTC