Hacker News new | ask | show | jobs
by nly 1041 days ago
It's only zero copy to parse/read. The builders allocate all over the place.
1 comments

A 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.