Hah, I thought the offset thing was pretty clever in that you can grab the binary slice without accumulating by character (which would be the naive approach). But it looks like :binary.match() is a nif and there’s no beating that. Thanks for the tip, I’ll keep that in mind.
If you’re reading that code I should note that I only implemented enough of Keyset to be useful internally. The first implementations of a lot of the internals were scaffolded out with hacky manual string encodings and that quickly became an actual problem so I needed some sane form of binary encoding.
I was going to make a point about how unfortunate it is that we can’t prefix the strings with their lengths but I see you already mentioned that in the PR! This is a case where I think the value encodings can make a much better tradeoff by including a header with types/offsets/lengths at the start of each value. That way you don’t have to decode the entire value (much larger than a key) in order to pull out a “column”. Obviously the values have no ordering requirement.






















