Re: [protobuf] Binary protocol optimization recomendations

2017-11-06 Thread Andrey Dotsenko
> > Well no. I mentioned "*declared last*" for a reason. You meant first? Because position of last fields depends on size of previsous fields. Unfortunately for v3, they removed the "*required*" semantics. > In fact required/optional division had no sense as I think. More securely and

Re: [protobuf] Binary protocol optimization recomendations

2017-11-06 Thread Andrey Dotsenko
I didn't saw the sources of protobuf, but using fields count is O(1) too. The overhead is only one more function to decode a submessage. When all you need to peek are numbers, you can have O(1) access to your > data by simply arranging your proto definition where all float, double, > fixed32

Re: [protobuf] Binary protocol optimization recomendations

2017-11-06 Thread David Yu
On Mon, Nov 6, 2017 at 3:28 AM, Andrey Dotsenko wrote: > Hi again! > > I'm trying to write library for C with minimal memory allocations and I've > encounted that protocol is not as perfect as I thought. My aim is embedded > systems but with compatibility mode with Protocol

[protobuf] Binary protocol optimization recomendations

2017-11-05 Thread Andrey Dotsenko
Hi again! I'm trying to write library for C with minimal memory allocations and I've encounted that protocol is not as perfect as I thought. My aim is embedded systems but with compatibility mode with Protocol Buffers v3. That would ease writing complex software using different languages while