feat(storage) CacheTable
rewrite
#497
Draft
+206
−131
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR rewrites the
CacheTable
used for the L2 block manager (and soon the L1BM) to increase performance.It adds the following dependencies:
broadcast::Receiver
cannot be cloned - you need theSender
to create newReceiver
s. Kanal's channels are cooler and let you do this, which gets rid of the Arcing we were previously doing, allowing concurrent map to cloneSlot
s when necessaryHasher
implementation. Uses hardware AES when available. Non-cryptographic.CacheAdvisor
identifies objects viau64
keys. To keep the cache generic, we requireV: Hash
and then internally useu64
s to identify things in the map. So a bit of a hybrid between a B+ tree and a hash map.Note that the new
CacheTable
isSend
but!Sync
. You cannot share a single instantiation between threads. This is the biggest API-level change. The way to share it across threads is by cloning, and giving a new clone of theCacheTable
whenever it might switch threads, like for a tokio task.I haven't yet tested the performance of this implementation, but I've built something using the same tooling and similar algorithms before. These things are usually blisteringly quick.
Type of Change
Checklist
Related Issues
STR-627