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 aModule
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.
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 aModule
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.
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 aModule
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