xq icon indicating copy to clipboard operation
xq copied to clipboard

Rework on data structure

Open MiSawa opened this issue 3 years ago • 0 comments

About objects, I guess that

  • 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.

MiSawa avatar Feb 28 '22 12:02 MiSawa