-
Notifications
You must be signed in to change notification settings - Fork 279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perf: Persistent executor #5082
base: main
Are you sure you want to change the base?
Conversation
Not really comfortable with using unsafe. What is going under the hood is that |
Currently I tried to eliminate fn categorize_transactions<'block, 'state>(
transactions: Vec<AcceptedTransaction>,
state_block: &'block mut StateBlock<'state>,
) -> Vec<CommittedTransaction> {
let wasm_cache: WasmCache<'block, 'state> = WasmCache::new();
validate(tx1, state_block, &mut wasm_cache);
validate(tx2, state_block, &mut wasm_cache); // here borrow check error
...
}
fn validate(
tx: AcceptedTransaction,
state_block: &'block mut StateBlock<'state>,
wasm_cache: &mut WasmCache<'block, 'state>,
) {
...
}
|
6849085
to
31950d8
Compare
31950d8
to
309e6cf
Compare
eb45eca
to
c949df8
Compare
Rebased after #5113 |
3be87fd
to
3cfa2da
Compare
b911cba
to
ad5e300
Compare
Signed-off-by: Dmitry Murzin <[email protected]>
ad5e300
to
a70da30
Compare
Context
Meta issue: optimizing single peer tps #4727.
It was identified that executor related things takes noticeable amount of time (#3716 (comment)).
Fixes #3716
Solution
Single executor WASM instance will be used for validating all transactions of a block. It gives approximately 10-15% improvement of single peer tps (from 2900 to 3300). However there is a problem with lifetimes and I have to use a hack with
std::mem::transmute
to bypass borrow checker. Would be glad to hear opinions/suggestions about it.Review notes (optional)
Primary change is that data stored in
wasmtime::Store
was changed fromCommonState<...>
toOption<CommonState<...>>
Checklist
CONTRIBUTING.md
.