Skip to content

Commit

Permalink
Revert "fix: increase trie cache size (#5706)"
Browse files Browse the repository at this point in the history
This reverts commit f41190e.
  • Loading branch information
bowenwang1996 committed Jan 3, 2022
1 parent 4807978 commit a10ece2
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions core/store/src/trie/trie_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,8 @@ impl TrieStorage for TrieMemoryPartialStorage {
}

/// Maximum number of cache entries.
/// It was chosen to fit into RAM well. RAM spend on trie cache should not exceed
/// 50_000 * 4 (number of shards) * TRIE_LIMIT_CACHED_VALUE_SIZE = 800 MB.
/// In our tests on a single shard, it barely occupied 40 MB, which is dominated by state cache size
/// with 512 MB limit. The total RAM usage for a single shard was 1 GB.
#[cfg(not(feature = "no_cache"))]
const TRIE_MAX_CACHE_SIZE: usize = 50000;
const TRIE_MAX_CACHE_SIZE: usize = 10000;

#[cfg(feature = "no_cache")]
const TRIE_MAX_CACHE_SIZE: usize = 1;
Expand Down

0 comments on commit a10ece2

Please sign in to comment.