Maybe implement Merkle Patricia Tree for storing key/values of keys.
We have in several parts of the code BTreeSet<Vec<u8>> and BTreeMap<Vec<u8>, T>.
However, the keys share a lot of prefixes. Therefore, there is a possibility of improving the code.
The first step would be the change the base key of Linera views to be a sequence of Vec<u8> instead of a sequence of u8.
@Twey has similar ideas as well
Why Merkle? Wouldn't a generic radix/patricia trie be good enough?
Radix tries have one major limitation: they are inefficient. If you want to store one
(path, value)binding where thepath, like in Ethereum, is 64 characters long (the number of nibbles inbytes32), we will need over a kilobyte of extra space to store one level per character, and each lookup or delete will take the full 64 steps. The Patricia trie introduced in the following solves this issue.
source: https://ethereum.org/developers/docs/data-structures-and-encoding/patricia-merkle-trie#merkle-patricia-trees