Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: increase trie cache size (#5706)
Increase trie cache size to mitigate receipts undercharging issue. ## Validity We can increase cache size to 50_000, so the theoretical occupied size is 50_000 * 4 (num_shards) * 4_000 = 800 MB. In reality, `/usr/bin/time -v ` shows **520 -> 1070 MB** RAM growth which seem to be caused by #5212. This change have an impact like 30 MB. I've additionally checked that cache is full on my runs. ## Speedup On the sample of 30 receipts we considered, we have the following characteristics: ``` default settings: summary time = 3.3s, avg undercharging = 101 increase state cache size: summary time = 0.67s, avg undercharging = 21 increase state cache size + trie cache size = 50k: summary time = 0.5s, avg undercharging = 11.5 increase state cache size + trie cache size = 100k + reduce max value size to 1k: summary time = 0.3s, avg undercharging = 6.9 ``` For now, let's just increase cache size. On this sample we reduce undercharging 2x and summary execution time 1.3x. ## Testing * checking that cache is full; * existing tests, * estimating `/usr/bin/time -v ./state-viewer apply_range --start_index 54051433 --end_index 54053438 --shard_id 3`
- Loading branch information