Re:Fast key-value stores: An idea whose time has come and gone
by kentonv on Monday June 24, 2019 @02:12PM
(#20266565)
And all your integer fields must be < 128, right?
Yes, I suppose the branches in Protobuf can be pretty predictable. Still, you do generally have to examine each byte individually.
Re:Fast key-value stores: An idea whose time has come and gone
by shereadsthenews on Monday June 24, 2019 @02:30PM
(#20266778)
Sure. In this specific case of a kv store it's hard to imagine how to simplify it dramatically from protobuf. As a proto you might have: tag-length-key-tag-length-value. Instead you could store the key and value lengths in host format using 8-16 bytes: length-length-key-value. It's not _dramatically_ faster to decode this, and you traded away extensibility to get a marginal speedup.
Re:Fast key-value stores: An idea whose time has come and gone
by kentonv on Monday June 24, 2019 @02:54PM
(#20267069)
Sure, I was speaking in general, not specifically about the key-value case.
I think most serialization frameworks are likely to be overkill for such a use case, spending more time on setup than actual parsing.
Also note that storing the value (and maybe the key) with proper alignment might make it easier to use the data in-place, saving a copy.
Re:Fast key-value stores: An idea whose time has come and gone
by yencabulator on Saturday June 29, 2019 @08:05PM
(#20315612)
Hit 'y' before copying the link; the line numbers have already shifted.
This is the hot path in C++[1]. A really large amount of work has gone into protobuf C++ performance in the last 3 years or so.
1: https://github.com/protocolbuffers/protobuf/blob/master/src/...