solana
solana copied to clipboard
root_bank_cache
Problem
Locking is bad for performance. If the root bank hasn't changed we do not need to lock again.
Summary of Changes
- root_slot on BankForks is now an atomic
- BankForks can return a read-only wrapper of root_slot
- added a caching root bank that only locks the bank forks if the root bank has changed
Fixes #