Change from TagTree in choice for Tag array#443
Change from TagTree in choice for Tag array#443Nicceboy wants to merge 1 commit intolibrasn:mainfrom
Conversation
Doesn't this affect SET implementations though since they need to be able figure out what the tag is for each component and there could be multiple nested choice types? |
|
For nested choices it currently uses conditionally |
|
Also note - if |
3652b67 to
e443c84
Compare
e443c84 to
dcc6244
Compare
|
@Nicceboy friendly check in, is this still something you're interested in pursuing? |
|
This is still on the list, I just have been a bit busy. Maybe we can do binary search part later. |
dcc6244 to
cf4325e
Compare
I am still doing some benchmarking and optimizations, and it seems that
TagTree::tag_containstakes a lot time when there are manyChoicetypes in the overall type.It seems to call itself recursively at least once no matter what it contains.
This adds ups since when especially decoding
Choicevariant that is the last in order,tag_containscan be called 1 + amount of variants or even more.So I have tried to replace
TagTreewith simple&'static [Tag]whenever possible, including in Choice trait, and there is a pretty significant performance boost available.I still have to test if there are some side effects what current tests are not showing.
At least current codec implementations just want to know whether tag exists with VARIANTS/EXTENDED_VARIANTS so maybe this can be changed.