Stream: git-wasmtime

Topic: wasmtime / issue #4025 Remove rwlock around instantiating...


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

alexcrichton labeled issue #4025:

Currently whenever a module is instantiated within a store for the first time it will register itself within the global map of all modules so the signal handlers have a way to go from a faulting address to determine whether it's a wasm pc that should have faulted. This operation, however, is quite costly relative to many other things wasmtime does, especially because pthread rwlocks aren't necessarily known for their speed.

Instead we should probably skip this lock altogether. Instead we should probably perform the global registration task when a Module is created rather than when a Module is instantiated for the first time within a store. This will remove both the rwlock used when a module is instantiated as well as when a store is dropped and the module is unregistered in the global map.

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

alexcrichton opened issue #4025:

Currently whenever a module is instantiated within a store for the first time it will register itself within the global map of all modules so the signal handlers have a way to go from a faulting address to determine whether it's a wasm pc that should have faulted. This operation, however, is quite costly relative to many other things wasmtime does, especially because pthread rwlocks aren't necessarily known for their speed.

Instead we should probably skip this lock altogether. Instead we should probably perform the global registration task when a Module is created rather than when a Module is instantiated for the first time within a store. This will remove both the rwlock used when a module is instantiated as well as when a store is dropped and the module is unregistered in the global map.

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

alexcrichton closed issue #4025:

Currently whenever a module is instantiated within a store for the first time it will register itself within the global map of all modules so the signal handlers have a way to go from a faulting address to determine whether it's a wasm pc that should have faulted. This operation, however, is quite costly relative to many other things wasmtime does, especially because pthread rwlocks aren't necessarily known for their speed.

Instead we should probably skip this lock altogether. Instead we should probably perform the global registration task when a Module is created rather than when a Module is instantiated for the first time within a store. This will remove both the rwlock used when a module is instantiated as well as when a store is dropped and the module is unregistered in the global map.


Last updated: Dec 23 2024 at 12:05 UTC