Improve shared state cache contention (#9321)

This commit is contained in:
Arkadiy Paronyan
2021-07-14 13:29:03 +02:00
committed by GitHub
parent 5be9b3fc76
commit de2fdd15cb
2 changed files with 41 additions and 32 deletions
+2 -2
View File
@@ -1643,7 +1643,7 @@ impl<Block: BlockT> Backend<Block> {
self.changes_tries_storage.post_commit(changes_trie_cache_ops);
if let Some((enacted, retracted)) = cache_update {
self.shared_cache.lock().sync(&enacted, &retracted);
self.shared_cache.write().sync(&enacted, &retracted);
}
for m in meta_updates {
@@ -2052,7 +2052,7 @@ impl<Block: BlockT> sc_client_api::backend::Backend<Block> for Backend<Block> {
);
let database_cache = MemorySize::from_bytes(0);
let state_cache = MemorySize::from_bytes(
(*&self.shared_cache).lock().used_storage_cache_size(),
(*&self.shared_cache).read().used_storage_cache_size(),
);
let state_db = self.storage.state_db.memory_info();