4 ms·
It's only zero copy to parse/read. The builders allocate all over the place.
by nly 3y ago
It's only zero copy to parse/read. The builders allocate all over the place.
- kentonv 3y agoA MessageBuilder allocates a single large buffer, writes into it, and only allocates further if that buffer is exhausted. If you use a preallocated buffer you can avoid allocation entirely. Very different from Protobuf which allocates strings, arrays, and sub-messages all as separate heap objects.