20% of objects are not read (just deserialized from input, and discarded by the query),
75% of objects are not indexed (deserialized from input and serialized to output, but not examined),
4.9% of objects are not modified (indexed like .key doesn't have modifications like |=), and
only 0.1% of objects are actually modified.
If my guess was right, it'd probably make sense to use copy-on-write array-map (i.e. Vec<(Key, Value)>) (+ perhaps lazily create Trie<Key, EntryIndex>). Or maybe persistent version of Vec and Trie instead. Maybe Vec<Option<(Key, Value)>> to support fast deletion.
About objects, I guess that
.key
doesn't have modifications like|=
), andIf my guess was right, it'd probably make sense to use copy-on-write array-map (i.e.
Vec<(Key, Value)>
) (+ perhaps lazily createTrie<Key, EntryIndex>
). Or maybe persistent version ofVec
andTrie
instead. MaybeVec<Option<(Key, Value)>>
to support fast deletion.