solana/programs
behzad nouri a49ef49f87
optimizes ReadOnlyAccountsCache LRU eviction implementation (#22403)
ReadOnlyAccountsCache is using a background thread, table scan and sort
to implement LRU eviction policy:
https://github.com/solana-labs/solana/blob/eaa52bc93/runtime/src/read_only_accounts_cache.rs#L66-L73
https://github.com/solana-labs/solana/blob/eaa52bc93/runtime/src/read_only_accounts_cache.rs#L186-L191
https://github.com/solana-labs/solana/blob/eaa52bc93/runtime/src/read_only_accounts_cache.rs#L222

DashMap internally locks each shard when accessed; so a table scan in
the background thread can create a lot of lock contention.

This commit adds an index-list queue containing cached keys in the order
that they are accessed. Each hash-map entry also includes its index into
this queue.
When an item is first entered into the cache, it is added to the end of
the queue. Also each time an entry is looked up from the cache it is
moved to the end of queue. As a result, items in the queue are always
sorted in the order that they have last been accessed. When doing LRU
eviction, cache entries are evicted from the front of the queue.
Using index-list, all queue operations above are O(1) with low overhead
and so above achieves an efficient implementation of LRU cache eviction
policy.
2022-01-11 17:25:28 +00:00
..
address-lookup-table Add runtime support for address table lookups (#22223) 2022-01-07 11:59:09 +08:00
address-lookup-table-tests Prevent lookup tables from being closed during deactivation slot (#22221) 2022-01-04 04:42:29 +08:00
bpf optimizes ReadOnlyAccountsCache LRU eviction implementation (#22403) 2022-01-11 17:25:28 +00:00
bpf_loader Moves InvokeContext::return_data to TransactionContext. (#22411) 2022-01-10 18:26:51 +01:00
compute-budget Bump version to v1.10.0 2021-12-04 20:17:54 +00:00
config Bump serde from 1.0.132 to 1.0.133 (#22233) 2022-01-03 22:19:39 +00:00
stake Refactor: Remove `KeyedAccount` from program runtime (#22226) 2022-01-03 23:30:56 +01:00
vote Bump serde from 1.0.132 to 1.0.133 (#22233) 2022-01-03 22:19:39 +00:00
zk-token-proof Adapt zk-token-{sdk,proof-program} for use in the monorepo 2022-01-05 08:51:18 -08:00