index
index copied to clipboard
Use an `{encode,decode}_bin`-like interface for encoding/decoding
One remaining spot of allocations in index lives in the interface between index and repr, in the Key.encode: t -> string and Value.encode: t -> string functions of the functor argument.
These function allocate strings, but these are then blit into already existing buffers, then blit again in a file. This allocation should be avoided, by using an interface closer to repr's encode_bin.
Similar reasoning applies to decode, as this is heavily used during merges to decode all data keys.
See https://github.com/mirage/index/pull/287