Make CodeMap
lock-free
#1128
Labels
enhancement
New feature or request
optimization
An performance optimization issue.
research
Research intense work item.
Since #1122 Wasmi's internal
CodeMap
, that stores all the data of functions stored in theEngine
, is put entirely behind aMutex
based lock for all accesses.Link to
code_map.rs
: https://github.com/wasmi-labs/wasmi/blob/main/crates/wasmi/src/engine/code_map.rsBefore #1122, it was put behind an
RwLock
and wasread
-locked whenever Wasmi exeucted a function which was the root cause for the dead-lock that #1122 has fixed.The downsides of #1122 is that the performance of call-intense workload have regressed by roughly 5-10% which was acceptable given the importance of fixing the dead-lock.
However, ideally we want a lock-free version of
CodeMap
with hopefully improved performance, especially for accessing pre-compiled Wasm functions. Access of pre-compiled Wasm functions is part of the hot-path of the Wasmi executor and thus its performance is critical.An inspiring blog post about a lock-free append-only
Vec
implementation in Rust:https://ibraheem.ca/posts/a-lock-free-vector/
This issue is about tracking progress for the lock-free
CodeMap
implementation.The text was updated successfully, but these errors were encountered: