-
Notifications
You must be signed in to change notification settings - Fork 25
Optimizations of the trie implementation #199
Copy link
Copy link
Open
Labels
[Prio] LowShould be fixed if time permits but can be postponed.Should be fixed if time permits but can be postponed.[Size] Medium[Type] TaskAn additional feature or improvement.An additional feature or improvement.
Description
Task description
There are several opportunities for optimizations of the trie implementation, both space and time wise.
At least the following ones should be considered. Any changes should be accompanied by meaningful benchmarks or arguments why memory use is reduced.
Sub-tasks
- The
StemandMutStemtypes contain a "stem", a list of bytes. In the vast majority of cases, for non-malicious use, these will be very short, very rarely above 40 bytes. Thus a small-scale optimization where we would use something like tinyvec/smallvec for storing the key inline if it is small could be very beneficial to both performance, and reducing memory pressure and fragmentation. - When serializing (and in store_update) the node's children we now waste a full byte for the child tag. This is wasteful since we could just use the top 4 bits of the
Reference, still leaving 60 bits to address, which is more than will ever be needed.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
[Prio] LowShould be fixed if time permits but can be postponed.Should be fixed if time permits but can be postponed.[Size] Medium[Type] TaskAn additional feature or improvement.An additional feature or improvement.