You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At high transaction throughput, get_account and get_access_key are two of the most expensive items in Runtime::Apply. See for example this profile of apply-range from January 2025.
These calls to get_account, get_access_key happen sequentially in verify_and_charge_transaction. Getting them in parallel should shave some time of the critical path. With TrieUpdate becoming Send + Sync [#12981], this might become achievable.
The text was updated successfully, but these errors were encountered:
Simple approach using rayon::join degrades performance.
A more sophisticated approach could include worker threads that send/receive work over channels. At the moment TrieUpdate is Send + Sync only for immutable references, which makes this approach impractical.
Another approach could be based on getting data for more than one transaction in parallel, see below. Note that this conflicts with other work (e.g. #12983).
take the first n txs such that they all have different signers
prefetch (account, access_key) for these n accounts in parallel (ok as all signers are different)
process the transactions, passing in the prefetched data
repeat until all transactions are processed
This probably degrades performance when a chunk contains many txs coming from the same signer, which will make all n small. As a mitigation, if n is mostly small for a list of transactions then this prefetching could be disabled. Should be a O(num_txs) pre-check.
At high transaction throughput,
get_account
andget_access_key
are two of the most expensive items inRuntime::Apply
. See for example this profile ofapply-range
from January 2025.These calls to
get_account, get_access_key
happen sequentially in verify_and_charge_transaction. Getting them in parallel should shave some time of the critical path. WithTrieUpdate
becomingSend + Sync
[#12981], this might become achievable.The text was updated successfully, but these errors were encountered: