Currently Dictionary is a thin wrapper around ImmutableDictionry<K, V> (data structure wise). However, it does not share common data between copies, which is highly inefficient both space-wise and time-wise. I believe the memory consumption of Bencodex can be significantly reduced by changing its internal data structure to a trie which shares mutual data between instances rather than a naive hash map. As it would require much less memcpy, I expect it will be even faster than as is.
Currently
Dictionary
is a thin wrapper aroundImmutableDictionry<K, V>
(data structure wise). However, it does not share common data between copies, which is highly inefficient both space-wise and time-wise. I believe the memory consumption of Bencodex can be significantly reduced by changing its internal data structure to a trie which shares mutual data between instances rather than a naive hash map. As it would require much less memcpy, I expect it will be even faster than as is.