Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make binary serialization of value keys appendable
The previous binary serialisation format for value-keys, which is a 2D slice of bytes, started the number rows. This meant that given a set of bytes the function could determine how many rows to expect. But the tradeoff is that in order to append a new row to an existing serialized value-keys one had to change the uvarint representing the number of rows at the beginning of the value. Because the size is a uvarint, this could mean shifting bytes, etc. Instead, do not bother with storing the number of rows at all. Instead, simply keep reading a uvarint-sized bytes and expect that reading the last row should result in no leftover bytes. This allows further optimisations inside the store implementations, where rather than reading the entire value of value-keys from the store adding a value and re-serializing it, one could simply append a new value to the end of the already serialized value-keys.
- Loading branch information