turbofish-org / orga

State machine engine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Key and Value types for Store

mappum opened this issue · comments

The current Store trait uses &[u8] and Vec<u8> for keys and values in get/put/delete.

There are a few optimizations we can make based on ways we use these keys:

  • We often prefix keys, but we should be able to cheaply concatenate similar to chaining iterators, rather than allocating/coping each time.
  • Keys could store cached hashes (see #7) or Bloom filter indices (see #9) to speed up set operations.
  • We can probably make both Key and Value more flexible in terms of supporting both references and owned data (to reduce the amount of copying needed).